Clean-up: declare variables at beginning of scope
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 2 Nov 2015 21:46:16 +0000 (16:46 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 2 Nov 2015 21:46:54 +0000 (16:46 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/utils.c

index f1a717a8b5092156679025f2ea9f0b461f737784..ee53477de559fedaf43eabfa194ee3255e58b293 100644 (file)
@@ -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)",
This page took 0.026407 seconds and 4 git commands to generate.