diff options
author | Rob Landley <rob@landley.net> | 2006-05-07 20:20:34 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-05-07 20:20:34 +0000 |
commit | a3896511152cd5dcd64d2eb4aebcce65b29c6c0b (patch) | |
tree | 0058e653d90a3d2a961fca16f7c7afd57cd63715 /networking/ifupdown.c | |
parent | f8a808426745ee5f4e5cc76ff1fb9c484c315195 (diff) | |
download | busybox-w32-a3896511152cd5dcd64d2eb4aebcce65b29c6c0b.tar.gz busybox-w32-a3896511152cd5dcd64d2eb4aebcce65b29c6c0b.tar.bz2 busybox-w32-a3896511152cd5dcd64d2eb4aebcce65b29c6c0b.zip |
Remove bb_strlen() in favor of -fno-builtin-strlen. Saves as many bytes
as the old optimization did (actually does slightly better under gcc 4.0), and
simplifies the code.
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 3d7bd7e19..32b92fb62 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -256,7 +256,7 @@ static char *parse(char *command, struct interface_defn_t *ifd) | |||
256 | varvalue = get_var(command, nextpercent - command, ifd); | 256 | varvalue = get_var(command, nextpercent - command, ifd); |
257 | 257 | ||
258 | if (varvalue) { | 258 | if (varvalue) { |
259 | addstr(&result, &len, &pos, varvalue, bb_strlen(varvalue)); | 259 | addstr(&result, &len, &pos, varvalue, strlen(varvalue)); |
260 | } else { | 260 | } else { |
261 | #ifdef CONFIG_FEATURE_IFUPDOWN_IP | 261 | #ifdef CONFIG_FEATURE_IFUPDOWN_IP |
262 | /* Sigh... Add a special case for 'ip' to convert from | 262 | /* Sigh... Add a special case for 'ip' to convert from |
@@ -267,7 +267,7 @@ static char *parse(char *command, struct interface_defn_t *ifd) | |||
267 | if (varvalue && (res=count_netmask_bits(varvalue)) > 0) { | 267 | if (varvalue && (res=count_netmask_bits(varvalue)) > 0) { |
268 | char argument[255]; | 268 | char argument[255]; |
269 | sprintf(argument, "%d", res); | 269 | sprintf(argument, "%d", res); |
270 | addstr(&result, &len, &pos, argument, bb_strlen(argument)); | 270 | addstr(&result, &len, &pos, argument, strlen(argument)); |
271 | command = nextpercent + 1; | 271 | command = nextpercent + 1; |
272 | break; | 272 | break; |
273 | } | 273 | } |
@@ -763,7 +763,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename) | |||
763 | { | 763 | { |
764 | int i; | 764 | int i; |
765 | 765 | ||
766 | if (bb_strlen(buf_ptr) == 0) { | 766 | if (strlen(buf_ptr) == 0) { |
767 | bb_error_msg("option with empty value \"%s\"", buf); | 767 | bb_error_msg("option with empty value \"%s\"", buf); |
768 | return NULL; | 768 | return NULL; |
769 | } | 769 | } |
@@ -845,7 +845,7 @@ static char *setlocalenv(char *format, const char *name, const char *value) | |||
845 | char *here; | 845 | char *here; |
846 | char *there; | 846 | char *there; |
847 | 847 | ||
848 | result = xmalloc(bb_strlen(format) + bb_strlen(name) + bb_strlen(value) + 1); | 848 | result = xmalloc(strlen(format) + strlen(name) + strlen(value) + 1); |
849 | 849 | ||
850 | sprintf(result, format, name, value); | 850 | sprintf(result, format, name, value); |
851 | 851 | ||
@@ -860,7 +860,7 @@ static char *setlocalenv(char *format, const char *name, const char *value) | |||
860 | here++; | 860 | here++; |
861 | } | 861 | } |
862 | } | 862 | } |
863 | memmove(here, there, bb_strlen(there) + 1); | 863 | memmove(here, there, strlen(there) + 1); |
864 | 864 | ||
865 | return result; | 865 | return result; |
866 | } | 866 | } |
@@ -1061,7 +1061,7 @@ static char *run_mapping(char *physical, struct mapping_defn_t * map) | |||
1061 | /* If we are able to read a line of output from the script, | 1061 | /* If we are able to read a line of output from the script, |
1062 | * remove any trailing whitespace and use this value | 1062 | * remove any trailing whitespace and use this value |
1063 | * as the name of the logical interface. */ | 1063 | * as the name of the logical interface. */ |
1064 | char *pch = new_logical + bb_strlen(new_logical) - 1; | 1064 | char *pch = new_logical + strlen(new_logical) - 1; |
1065 | 1065 | ||
1066 | while (pch >= new_logical && isspace(*pch)) | 1066 | while (pch >= new_logical && isspace(*pch)) |
1067 | *(pch--) = '\0'; | 1067 | *(pch--) = '\0'; |
@@ -1083,7 +1083,7 @@ static char *run_mapping(char *physical, struct mapping_defn_t * map) | |||
1083 | 1083 | ||
1084 | static llist_t *find_iface_state(llist_t *state_list, const char *iface) | 1084 | static llist_t *find_iface_state(llist_t *state_list, const char *iface) |
1085 | { | 1085 | { |
1086 | unsigned short iface_len = bb_strlen(iface); | 1086 | unsigned short iface_len = strlen(iface); |
1087 | llist_t *search = state_list; | 1087 | llist_t *search = state_list; |
1088 | 1088 | ||
1089 | while (search) { | 1089 | while (search) { |
@@ -1308,7 +1308,7 @@ int ifupdown_main(int argc, char **argv) | |||
1308 | llist_t *iface_state = find_iface_state(state_list, iface); | 1308 | llist_t *iface_state = find_iface_state(state_list, iface); |
1309 | 1309 | ||
1310 | if (cmds == iface_up) { | 1310 | if (cmds == iface_up) { |
1311 | char *newiface = xmalloc(bb_strlen(iface) + 1 + bb_strlen(liface) + 1); | 1311 | char *newiface = xmalloc(strlen(iface) + 1 + strlen(liface) + 1); |
1312 | sprintf(newiface, "%s=%s", iface, liface); | 1312 | sprintf(newiface, "%s=%s", iface, liface); |
1313 | if (iface_state == NULL) { | 1313 | if (iface_state == NULL) { |
1314 | state_list = llist_add_to_end(state_list, newiface); | 1314 | state_list = llist_add_to_end(state_list, newiface); |