Commit a877bc4d authored by Thomas Roessler's avatar Thomas Roessler

Fix #1171.

parent e8471383
......@@ -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);
}
......
......@@ -64,11 +64,18 @@
# define STRING 256
# define SHORT_STRING 128
# define FREE(x) safe_free((void **)x)
# define NONULL(x) x?x:""
# define ISSPACE(c) isspace((unsigned char)c)
# define strfcpy(A,B,C) strncpy(A,B,C), *(A+(C)-1)=0
# undef MAX
# undef MIN
# define MAX(a,b) ((a) < (b) ? (b) : (a))
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#define FOREVER while (1)
/* this macro must check for *c == 0 since isspace(0) has unreliable behavior
......
......@@ -25,11 +25,6 @@
#define dprint(N,X)
#endif
#undef MAX
#undef MIN
#define MAX(a,b) ((a) < (b) ? (b) : (a))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MoreArgs(p) (*p->dptr && *p->dptr != ';' && *p->dptr != '#')
#define mutt_make_string(A,B,C,D,E) _mutt_make_string(A,B,C,D,E,0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment