From 853e48bfca397d7f92eb88f63c5fd481e0196387 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Fri, 4 Jan 2019 11:20:05 -0800 Subject: [PATCH] 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. --- mkdtemp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.50.1