diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-04 13:20:36 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-08-04 13:20:36 +0000 |
commit | 27842288b393e532e5693f2a2bab94fee73a326d (patch) | |
tree | 98535c0fd140c89aa6b83179b11d160e6ed59c28 /util-linux | |
parent | 2b576b8e76ee0dc548f46489e2546b7ed70d080d (diff) | |
download | busybox-w32-27842288b393e532e5693f2a2bab94fee73a326d.tar.gz busybox-w32-27842288b393e532e5693f2a2bab94fee73a326d.tar.bz2 busybox-w32-27842288b393e532e5693f2a2bab94fee73a326d.zip |
libbb: make xrealloc_vector zero out the realloc'ed tail
function old new delta
xrealloc_vector_helper 51 76 +25
man_main 712 705 -7
act 250 234 -16
create_list 91 70 -21
getopt_main 695 664 -31
load_dep_bb 281 248 -33
fileAction 744 709 -35
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 25/-143) Total: -118 bytes
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/getopt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 25aa4069a..402630385 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
@@ -238,14 +238,13 @@ static struct option *add_long_options(struct option *long_options, char *option | |||
238 | if (tlen == 0) | 238 | if (tlen == 0) |
239 | bb_error_msg_and_die("empty long option specified"); | 239 | bb_error_msg_and_die("empty long option specified"); |
240 | } | 240 | } |
241 | //TODO: zeroing version of xrealloc_vector! | ||
242 | long_options = xrealloc_vector(long_options, 4, long_nr); | 241 | long_options = xrealloc_vector(long_options, 4, long_nr); |
243 | long_options[long_nr].has_arg = arg_opt; | 242 | long_options[long_nr].has_arg = arg_opt; |
244 | long_options[long_nr].flag = NULL; | 243 | /*long_options[long_nr].flag = NULL; - xrealloc_vector did it */ |
245 | long_options[long_nr].val = LONG_OPT; | 244 | long_options[long_nr].val = LONG_OPT; |
246 | long_options[long_nr].name = xstrdup(tokptr); | 245 | long_options[long_nr].name = xstrdup(tokptr); |
247 | long_nr++; | 246 | long_nr++; |
248 | memset(&long_options[long_nr], 0, sizeof(long_options[0])); | 247 | /*memset(&long_options[long_nr], 0, sizeof(long_options[0])); - xrealloc_vector did it */ |
249 | } | 248 | } |
250 | tokptr = strtok(NULL, ", \t\n"); | 249 | tokptr = strtok(NULL, ", \t\n"); |
251 | } | 250 | } |