- 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
This commit is contained in:
parent
52a9db6bb8
commit
eceecea568
6 changed files with 115 additions and 88 deletions
|
@ -25,12 +25,11 @@ int index_in_substr_array(const char * const string_array[], const char *key)
|
|||
{
|
||||
int i;
|
||||
int len = strlen(key);
|
||||
if (!len)
|
||||
return -1;
|
||||
|
||||
for (i = 0; string_array[i] != 0; i++) {
|
||||
if (strncmp(string_array[i], key, len) == 0) {
|
||||
return i;
|
||||
if (len) {
|
||||
for (i = 0; string_array[i] != 0; i++) {
|
||||
if (strncmp(string_array[i], key, len) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue