summaryrefslogtreecommitdiffstats
path: root/mkdtemp.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-01-04 11:20:05 -0800
committerKevin McCarthy <kevin@8t8.us>2019-01-04 11:20:05 -0800
commit853e48bfca397d7f92eb88f63c5fd481e0196387 (patch)
treed01d16aaa11106615600f314108c38c49d3a2926 /mkdtemp.c
parent63f05d9682a7612e3022aa325a9b64b670f4c341 (diff)
Fix mkdtemp.c implementation.
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.
Diffstat (limited to 'mkdtemp.c')
-rw-r--r--mkdtemp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mkdtemp.c b/mkdtemp.c
index ae9d5d9e..55d907f0 100644
--- 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)