Browse Source

tools: avoid needless post increment on size

Also add a note about a possible segfault.
Brad Hards 15 years ago
parent
commit
c6bbde3a1b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      tools/namespacize.c

+ 2 - 1
tools/namespacize.c

@@ -53,7 +53,8 @@ static char **get_dir(const char *dir)
 		names[size++]
 			= talloc_asprintf(names, "%s/%s", dir, ent->d_name);
 	}
-	names[size++] = NULL;
+	/* FIXME: if the loop doesn't run at least once, we'll segfault here */
+	names[size] = NULL;
 	closedir(d);
 	return names;
 }