X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=mh.c;h=bba47aec963a43ec46bf55eeefea04520924ba72;hb=b07d69b15852a06183f7b2298436e18150c36958;hp=8f40b397833c4f1fd155011559f4164a48332874;hpb=2ea77d3b2827ba23feb756ce2fb936565ae38998;p=apps%2Fmadmutt.git diff --git a/mh.c b/mh.c index 8f40b39..bba47ae 100644 --- a/mh.c +++ b/mh.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "mutt.h" #include "mx.h" @@ -200,7 +201,7 @@ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) int fd; char path[_POSIX_PATH_MAX]; - FOREVER { + for (;;) { snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d", dest->path, NONULL (Hostname), (int) getpid (), Counter++); umask (Umask); @@ -1047,7 +1048,7 @@ static int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr else strfcpy (subdir, "new", sizeof (subdir)); - FOREVER { + for (;;) { snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s", dest->path, subdir, (long) time (NULL), (unsigned int) getpid (), Counter++, NONULL (Hostname), suffix); @@ -1123,7 +1124,7 @@ static int maildir_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr) suffix[0] = '\0'; /* construct a new file name. */ - FOREVER { + for (;;) { snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir, (long) time (NULL), (unsigned int) getpid (), Counter++, NONULL (Hostname), suffix); @@ -1213,7 +1214,7 @@ static int _mh_commit_message (MESSAGE * msg, CONTEXT * ctx, HEADER * hdr, * slot. */ - FOREVER { + for (;;) { hi++; snprintf (tmp, sizeof (tmp), "%d", hi); snprintf (path, sizeof (path), "%s/%s", ctx->path, tmp);