From 3763af876473398a1960467807b6516809a9466b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 2 Nov 2015 16:46:16 -0500 Subject: [PATCH] Clean-up: declare variables at beginning of scope MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/common/utils.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/utils.c b/src/common/utils.c index f1a717a8b..ee53477de 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -1231,14 +1231,15 @@ int utils_recursive_rmdir(const char *path) path_len = strlen(path); while ((entry = readdir(dir))) { - if (!strcmp(entry->d_name, ".") - || !strcmp(entry->d_name, "..")) - continue; - struct stat st; size_t name_len; char filename[PATH_MAX]; + if (!strcmp(entry->d_name, ".") + || !strcmp(entry->d_name, "..")) { + continue; + } + name_len = strlen(entry->d_name); if (path_len + name_len + 2 > sizeof(filename)) { ERR("Failed to remove file: path name too long (%s/%s)", -- 2.34.1