]> granicus.if.org Git - mutt/commitdiff
Fix mkdtemp.c implementation.
authorKevin McCarthy <kevin@8t8.us>
Fri, 4 Jan 2019 19:20:05 +0000 (11:20 -0800)
committerKevin McCarthy <kevin@8t8.us>
Fri, 4 Jan 2019 19:20:05 +0000 (11:20 -0800)
Two statements were indented on the same line under a for statement.
The second one would not be included in the loop, only being executed
after the loop finishes.

This is obviously an error, as it modifies the LETTERS entry being
used.

mkdtemp.c

index ae9d5d9e82f0331b7b81f544250d982d6b7d0de7..55d907f0bd6573d56de6cbfa98c42533afd7157a 100644 (file)
--- a/mkdtemp.c
+++ b/mkdtemp.c
@@ -28,7 +28,10 @@ char *mkdtemp (char *tmpl)
     {
         /* fill in the random bits */
         for (j = 0, v = value; j < 6; ++j)
-            tmpl[(len - 6) + j] = LETTERS[v % 62]; v /= 62;
+        {
+            tmpl[(len - 6) + j] = LETTERS[v % 62];
+            v /= 62;
+        }
 
         /* try to create the directory */
         if (mkdir (tmpl, 0700) == 0)