summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2002-04-29 17:12:00 +0000
committerThomas Roessler <roessler@does-not-exist.org>2002-04-29 17:12:00 +0000
commit17ecedd391d8bdb019c949a18d4a09895b1302dd (patch)
tree3f5ff5ceee7c69d2bcc4224d0e09a4cf7af88550 /lib.c
parentb15772057ed7fb5275b31ab170e0cbe8c358a951 (diff)
Fix #1171.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 9aa94831..a9dad9de 100644
--- a/lib.c
+++ b/lib.c
@@ -183,8 +183,8 @@ void mutt_unlink (const char *s)
memset (buf, 0, sizeof (buf));
while (sb.st_size > 0)
{
- fwrite (buf, 1, sizeof (buf), f);
- sb.st_size -= sizeof (buf);
+ fwrite (buf, 1, MIN (sizeof (buf), sb.st_size), f);
+ sb.st_size -= MIN (sizeof (buf), sb.st_size);
}
fclose (f);
}