From 727be2989365826a51d7c2dd8ec608de344fca49 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 25 Nov 2012 09:46:40 -0500 Subject: [PATCH] Saner loop invariant in io_mkdirs (cosmetic only). --- plugins/sudoers/iolog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/sudoers/iolog.c b/plugins/sudoers/iolog.c index b687ad105..60fba6132 100644 --- a/plugins/sudoers/iolog.c +++ b/plugins/sudoers/iolog.c @@ -121,9 +121,7 @@ io_mkdirs(char *path, mode_t mode, bool is_temp) debug_return; } - for (;;) { - if ((slash = strchr(slash + 1, '/')) == NULL) - break; + while ((slash = strchr(slash + 1, '/')) != NULL) { *slash = '\0'; if (stat(path, &sb) != 0) { if (mkdir(path, mode) != 0) -- 2.40.0