projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
4fc9ee3
)
tools: avoid needless post increment on size
author
Brad Hards
<bradh@frogmouth.net>
Tue, 8 Mar 2011 09:28:13 +0000
(20:28 +1100)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Wed, 16 Mar 2011 04:24:13 +0000
(14:54 +1030)
Also add a note about a possible segfault.
tools/namespacize.c
patch
|
blob
|
history
diff --git
a/tools/namespacize.c
b/tools/namespacize.c
index 5ac85f502f2abb0f5cc9cea1d583c68fdf5546d0..cf6bc26d7c4983a8d3483c976ecb9428ad8ebaac 100644
(file)
--- a/
tools/namespacize.c
+++ b/
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;
}