diff options
author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-03-30 14:43:27 +0000 |
---|---|---|
committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-03-30 14:43:27 +0000 |
commit | 835be9660f5948f6d638432451eaee7633c5e0d1 (patch) | |
tree | 7faa56bbba59529be6f671026ae97bda84267917 /libbb | |
parent | f7b12a492d021b587e29e7614adcb9d9177e306c (diff) | |
download | busybox-w32-835be9660f5948f6d638432451eaee7633c5e0d1.tar.gz busybox-w32-835be9660f5948f6d638432451eaee7633c5e0d1.tar.bz2 busybox-w32-835be9660f5948f6d638432451eaee7633c5e0d1.zip |
- fix bug where we did not reject invalid classes like '[[:alpha'
- debloat while at it:
text data bss dec hex filename
1554 0 19 1573 625 tr.o.oorig
1357 0 16 1373 55d tr.o
git-svn-id: svn://busybox.net/trunk/busybox@18281 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/compare_string_array.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c index d15578ca3..077a280a2 100644 --- a/libbb/compare_string_array.c +++ b/libbb/compare_string_array.c | |||
@@ -25,12 +25,11 @@ int index_in_substr_array(const char * const string_array[], const char *key) | |||
25 | { | 25 | { |
26 | int i; | 26 | int i; |
27 | int len = strlen(key); | 27 | int len = strlen(key); |
28 | if (!len) | 28 | if (len) { |
29 | return -1; | 29 | for (i = 0; string_array[i] != 0; i++) { |
30 | 30 | if (strncmp(string_array[i], key, len) == 0) { | |
31 | for (i = 0; string_array[i] != 0; i++) { | 31 | return i; |
32 | if (strncmp(string_array[i], key, len) == 0) { | 32 | } |
33 | return i; | ||
34 | } | 33 | } |
35 | } | 34 | } |
36 | return -1; | 35 | return -1; |