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);
}
# define MUTT_FORMAT(a) _MUTT_FORMAT_1(a, "s")
# define MUTT_FORMAT2(a,b) _MUTT_FORMAT_1(a, b)
+
# 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
#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)