From: Jérémie Galarneau Date: Mon, 2 Nov 2015 21:46:16 +0000 (-0500) Subject: Clean-up: declare variables at beginning of scope X-Git-Tag: v2.8.0-rc1~237 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3763af876473398a1960467807b6516809a9466b;p=lttng-tools.git Clean-up: declare variables at beginning of scope Signed-off-by: Jérémie Galarneau --- 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)",