diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-07-17 11:59:13 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-07-17 11:59:13 +0000 |
commit | 679212836a881b53382ea6bd811f38e00705d50d (patch) | |
tree | e5c349683a57c55b650eae77b1ca5ac40c94a175 /networking | |
parent | 0f683f818cf087d580ba2edf7c096897bc28b95a (diff) | |
download | busybox-679212836a881b53382ea6bd811f38e00705d50d.tar.gz |
- fix segfault in nameif with mactab file
(by fixing and shrink config parser)
function old new delta
config_free_data - 37 +37
config_open 43 48 +5
pack_gzip 1658 1660 +2
nameif_main 527 525 -2
SynchronizeFile 629 623 -6
make_device 1184 1176 -8
config_close 31 18 -13
config_read 431 393 -38
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 2/5 up/down: 44/-67) Total: -23 bytes
Diffstat (limited to 'networking')
-rw-r--r-- | networking/nameif.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/nameif.c b/networking/nameif.c index c5a715e36..291780a28 100644 --- a/networking/nameif.c +++ b/networking/nameif.c @@ -160,12 +160,12 @@ int nameif_main(int argc, char **argv) prepend_new_eth_table(&clist, ifname, *argv++); } } else { - struct parser_t parser; - if (config_open(&parser, fname)) { + struct parser_t *parser = config_open(fname); + if (parser) { char *tokens[2]; - while (config_read(&parser, tokens, 2, 2, " \t", '#') >= 0) + while (config_read(parser, tokens, 2, 2, " \t", '#') >= 0) prepend_new_eth_table(&clist, tokens[0], tokens[1]); - config_close(&parser); + config_close(parser); } } |