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 | |
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.
-rw-r--r-- | Rules.mak | 1 | ||||
-rw-r--r-- | archival/dpkg.c | 2 | ||||
-rw-r--r-- | debianutils/which.c | 4 | ||||
-rw-r--r-- | editors/awk.c | 28 | ||||
-rw-r--r-- | include/platform.h | 5 | ||||
-rw-r--r-- | libbb/Makefile.in | 4 | ||||
-rw-r--r-- | libbb/correct_password.c | 2 | ||||
-rw-r--r-- | libbb/xfuncs.c | 9 | ||||
-rw-r--r-- | loginutils/login.c | 2 | ||||
-rw-r--r-- | modutils/modprobe.c | 4 | ||||
-rw-r--r-- | networking/arping.c | 2 | ||||
-rw-r--r-- | networking/ifupdown.c | 16 | ||||
-rw-r--r-- | procps/sysctl.c | 4 | ||||
-rw-r--r-- | util-linux/hwclock.c | 4 |
14 files changed, 37 insertions, 50 deletions
@@ -125,6 +125,7 @@ check_ld=$(shell \ | |||
125 | # Pin CHECKED_CFLAGS with := so it's only evaluated once. | 125 | # Pin CHECKED_CFLAGS with := so it's only evaluated once. |
126 | CHECKED_CFLAGS:=$(call check_gcc,-funsigned-char,) | 126 | CHECKED_CFLAGS:=$(call check_gcc,-funsigned-char,) |
127 | CHECKED_CFLAGS+=$(call check_gcc,-mmax-stack-frame=256,) | 127 | CHECKED_CFLAGS+=$(call check_gcc,-mmax-stack-frame=256,) |
128 | CHECKED_CFLAGS+=$(call check_gcc,-fno-builtin-strlen) | ||
128 | 129 | ||
129 | # Preemptively pin this too. | 130 | # Preemptively pin this too. |
130 | PROG_CFLAGS:= | 131 | PROG_CFLAGS:= |
diff --git a/archival/dpkg.c b/archival/dpkg.c index 74d3a83d9..3621db41d 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1573,7 +1573,7 @@ static void unpack_package(deb_file_t *deb_file) | |||
1573 | init_archive_deb_control(archive_handle); | 1573 | init_archive_deb_control(archive_handle); |
1574 | 1574 | ||
1575 | while(all_control_files[i]) { | 1575 | while(all_control_files[i]) { |
1576 | char *c = (char *) xmalloc(3 + bb_strlen(all_control_files[i])); | 1576 | char *c = (char *) xmalloc(3 + strlen(all_control_files[i])); |
1577 | sprintf(c, "./%s", all_control_files[i]); | 1577 | sprintf(c, "./%s", all_control_files[i]); |
1578 | accept_list= llist_add_to(accept_list, c); | 1578 | accept_list= llist_add_to(accept_list, c); |
1579 | i++; | 1579 | i++; |
diff --git a/debianutils/which.c b/debianutils/which.c index 4d206ab29..f2991c561 100644 --- a/debianutils/which.c +++ b/debianutils/which.c | |||
@@ -29,7 +29,7 @@ int which_main(int argc, char **argv) | |||
29 | 29 | ||
30 | path_list = getenv("PATH"); | 30 | path_list = getenv("PATH"); |
31 | if (path_list != NULL) { | 31 | if (path_list != NULL) { |
32 | size_t path_len = bb_strlen(path_list); | 32 | size_t path_len = strlen(path_list); |
33 | char *new_list = NULL; | 33 | char *new_list = NULL; |
34 | count = 1; | 34 | count = 1; |
35 | 35 | ||
@@ -88,7 +88,7 @@ int which_main(int argc, char **argv) | |||
88 | break; | 88 | break; |
89 | } | 89 | } |
90 | free(buf); | 90 | free(buf); |
91 | path_n += (bb_strlen(path_n) + 1); | 91 | path_n += (strlen(path_n) + 1); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | if (found) { | 94 | if (found) { |
diff --git a/editors/awk.c b/editors/awk.c index e11c8350f..9c8bef53a 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -534,7 +534,7 @@ static void *hash_find(xhash *hash, const char *name) | |||
534 | if (++hash->nel / hash->csize > 10) | 534 | if (++hash->nel / hash->csize > 10) |
535 | hash_rebuild(hash); | 535 | hash_rebuild(hash); |
536 | 536 | ||
537 | l = bb_strlen(name) + 1; | 537 | l = strlen(name) + 1; |
538 | hi = xcalloc(sizeof(hash_item) + l, 1); | 538 | hi = xcalloc(sizeof(hash_item) + l, 1); |
539 | memcpy(hi->name, name, l); | 539 | memcpy(hi->name, name, l); |
540 | 540 | ||
@@ -559,7 +559,7 @@ static void hash_remove(xhash *hash, const char *name) | |||
559 | while (*phi) { | 559 | while (*phi) { |
560 | hi = *phi; | 560 | hi = *phi; |
561 | if (strcmp(hi->name, name) == 0) { | 561 | if (strcmp(hi->name, name) == 0) { |
562 | hash->glen -= (bb_strlen(name) + 1); | 562 | hash->glen -= (strlen(name) + 1); |
563 | hash->nel--; | 563 | hash->nel--; |
564 | *phi = hi->next; | 564 | *phi = hi->next; |
565 | free(hi); | 565 | free(hi); |
@@ -1364,7 +1364,7 @@ static node *mk_splitter(char *s, tsplitter *spl) | |||
1364 | regfree(re); | 1364 | regfree(re); |
1365 | regfree(ire); | 1365 | regfree(ire); |
1366 | } | 1366 | } |
1367 | if (bb_strlen(s) > 1) { | 1367 | if (strlen(s) > 1) { |
1368 | mk_re_node(s, n, re); | 1368 | mk_re_node(s, n, re); |
1369 | } else { | 1369 | } else { |
1370 | n->info = (uint32_t) *s; | 1370 | n->info = (uint32_t) *s; |
@@ -1432,7 +1432,7 @@ static int awk_split(char *s, node *spl, char **slist) | |||
1432 | regmatch_t pmatch[2]; | 1432 | regmatch_t pmatch[2]; |
1433 | 1433 | ||
1434 | /* in worst case, each char would be a separate field */ | 1434 | /* in worst case, each char would be a separate field */ |
1435 | *slist = s1 = bb_xstrndup(s, bb_strlen(s) * 2 + 3); | 1435 | *slist = s1 = bb_xstrndup(s, strlen(s) * 2 + 3); |
1436 | 1436 | ||
1437 | c[0] = c[1] = (char)spl->info; | 1437 | c[0] = c[1] = (char)spl->info; |
1438 | c[2] = c[3] = '\0'; | 1438 | c[2] = c[3] = '\0'; |
@@ -1527,12 +1527,12 @@ static void handle_special(var *v) | |||
1527 | 1527 | ||
1528 | /* recalculate $0 */ | 1528 | /* recalculate $0 */ |
1529 | sep = getvar_s(V[OFS]); | 1529 | sep = getvar_s(V[OFS]); |
1530 | sl = bb_strlen(sep); | 1530 | sl = strlen(sep); |
1531 | b = NULL; | 1531 | b = NULL; |
1532 | len = 0; | 1532 | len = 0; |
1533 | for (i=0; i<n; i++) { | 1533 | for (i=0; i<n; i++) { |
1534 | s = getvar_s(&Fields[i]); | 1534 | s = getvar_s(&Fields[i]); |
1535 | l = bb_strlen(s); | 1535 | l = strlen(s); |
1536 | if (b) { | 1536 | if (b) { |
1537 | memcpy(b+len, sep, sl); | 1537 | memcpy(b+len, sep, sl); |
1538 | len += sl; | 1538 | len += sl; |
@@ -1769,7 +1769,7 @@ static char *awk_printf(node *n) | |||
1769 | 1769 | ||
1770 | } else if (c == 's') { | 1770 | } else if (c == 's') { |
1771 | s1 = getvar_s(arg); | 1771 | s1 = getvar_s(arg); |
1772 | qrealloc(&b, incr+i+bb_strlen(s1), &bsize); | 1772 | qrealloc(&b, incr+i+strlen(s1), &bsize); |
1773 | i += sprintf(b+i, s, s1); | 1773 | i += sprintf(b+i, s, s1); |
1774 | 1774 | ||
1775 | } else { | 1775 | } else { |
@@ -1809,7 +1809,7 @@ static int awk_sub(node *rn, char *repl, int nm, var *src, var *dest, int ex) | |||
1809 | 1809 | ||
1810 | i = di = 0; | 1810 | i = di = 0; |
1811 | sp = getvar_s(src); | 1811 | sp = getvar_s(src); |
1812 | rl = bb_strlen(repl); | 1812 | rl = strlen(repl); |
1813 | while (regexec(re, sp, 10, pmatch, sp==getvar_s(src) ? 0:REG_NOTBOL) == 0) { | 1813 | while (regexec(re, sp, 10, pmatch, sp==getvar_s(src) ? 0:REG_NOTBOL) == 0) { |
1814 | so = pmatch[0].rm_so; | 1814 | so = pmatch[0].rm_so; |
1815 | eo = pmatch[0].rm_eo; | 1815 | eo = pmatch[0].rm_eo; |
@@ -1922,7 +1922,7 @@ static var *exec_builtin(node *op, var *res) | |||
1922 | break; | 1922 | break; |
1923 | 1923 | ||
1924 | case B_ss: | 1924 | case B_ss: |
1925 | l = bb_strlen(as[0]); | 1925 | l = strlen(as[0]); |
1926 | i = getvar_i(av[1]) - 1; | 1926 | i = getvar_i(av[1]) - 1; |
1927 | if (i>l) i=l; if (i<0) i=0; | 1927 | if (i>l) i=l; if (i<0) i=0; |
1928 | n = (nargs > 2) ? getvar_i(av[2]) : l-i; | 1928 | n = (nargs > 2) ? getvar_i(av[2]) : l-i; |
@@ -1950,8 +1950,8 @@ lo_cont: | |||
1950 | 1950 | ||
1951 | case B_ix: | 1951 | case B_ix: |
1952 | n = 0; | 1952 | n = 0; |
1953 | ll = bb_strlen(as[1]); | 1953 | ll = strlen(as[1]); |
1954 | l = bb_strlen(as[0]) - ll; | 1954 | l = strlen(as[0]) - ll; |
1955 | if (ll > 0 && l >= 0) { | 1955 | if (ll > 0 && l >= 0) { |
1956 | if (! icase) { | 1956 | if (! icase) { |
1957 | s = strstr(as[0], as[1]); | 1957 | s = strstr(as[0], as[1]); |
@@ -2353,7 +2353,7 @@ re_cont: | |||
2353 | case F_le: | 2353 | case F_le: |
2354 | if (! op1) | 2354 | if (! op1) |
2355 | L.s = getvar_s(V[F0]); | 2355 | L.s = getvar_s(V[F0]); |
2356 | R.d = bb_strlen(L.s); | 2356 | R.d = strlen(L.s); |
2357 | break; | 2357 | break; |
2358 | 2358 | ||
2359 | case F_sy: | 2359 | case F_sy: |
@@ -2441,12 +2441,12 @@ re_cont: | |||
2441 | /* concatenation (" ") and index joining (",") */ | 2441 | /* concatenation (" ") and index joining (",") */ |
2442 | case XC( OC_CONCAT ): | 2442 | case XC( OC_CONCAT ): |
2443 | case XC( OC_COMMA ): | 2443 | case XC( OC_COMMA ): |
2444 | opn = bb_strlen(L.s) + bb_strlen(R.s) + 2; | 2444 | opn = strlen(L.s) + strlen(R.s) + 2; |
2445 | X.s = (char *)xmalloc(opn); | 2445 | X.s = (char *)xmalloc(opn); |
2446 | strcpy(X.s, L.s); | 2446 | strcpy(X.s, L.s); |
2447 | if ((opinfo & OPCLSMASK) == OC_COMMA) { | 2447 | if ((opinfo & OPCLSMASK) == OC_COMMA) { |
2448 | L.s = getvar_s(V[SUBSEP]); | 2448 | L.s = getvar_s(V[SUBSEP]); |
2449 | X.s = (char *)xrealloc(X.s, opn + bb_strlen(L.s)); | 2449 | X.s = (char *)xrealloc(X.s, opn + strlen(L.s)); |
2450 | strcat(X.s, L.s); | 2450 | strcat(X.s, L.s); |
2451 | } | 2451 | } |
2452 | strcat(X.s, R.s); | 2452 | strcat(X.s, R.s); |
diff --git a/include/platform.h b/include/platform.h index a8858a74c..257ddb260 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -67,11 +67,6 @@ | |||
67 | # endif | 67 | # endif |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #ifdef __GNUC__ | ||
71 | #define strlen(x) bb_strlen(x) | ||
72 | extern size_t bb_strlen(const char *string); | ||
73 | #endif | ||
74 | |||
75 | /* ---- Endian Detection ------------------------------------ */ | 70 | /* ---- Endian Detection ------------------------------------ */ |
76 | #ifndef __APPLE__ | 71 | #ifndef __APPLE__ |
77 | # include <byteswap.h> | 72 | # include <byteswap.h> |
diff --git a/libbb/Makefile.in b/libbb/Makefile.in index 102047d73..865b7e726 100644 --- a/libbb/Makefile.in +++ b/libbb/Makefile.in | |||
@@ -69,7 +69,7 @@ $(LIBBB_MOBJ0):$(LIBBB_MSRC0) | |||
69 | LIBBB_MSRC1:=$(srcdir)/xfuncs.c | 69 | LIBBB_MSRC1:=$(srcdir)/xfuncs.c |
70 | LIBBB_MOBJ1:=xmalloc.o xrealloc.o xcalloc.o xstrdup.o xstrndup.o \ | 70 | LIBBB_MOBJ1:=xmalloc.o xrealloc.o xcalloc.o xstrdup.o xstrndup.o \ |
71 | xfopen.o xopen.o xopen3.o xread.o xread_all.o xread_char.o \ | 71 | xfopen.o xopen.o xopen3.o xread.o xread_all.o xread_char.o \ |
72 | xferror.o xferror_stdout.o xfflush_stdout.o strlen.o | 72 | xferror.o xferror_stdout.o xfflush_stdout.o |
73 | LIBBB_MOBJ1:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ1)) | 73 | LIBBB_MOBJ1:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ1)) |
74 | $(LIBBB_MOBJ1):$(LIBBB_MSRC1) | 74 | $(LIBBB_MOBJ1):$(LIBBB_MSRC1) |
75 | $(compile.c) -DL_$(notdir $*) | 75 | $(compile.c) -DL_$(notdir $*) |
@@ -101,7 +101,7 @@ $(LIBBB_MOBJ5):$(LIBBB_MSRC5) | |||
101 | $(compile.c) -DL_$(notdir $*) | 101 | $(compile.c) -DL_$(notdir $*) |
102 | 102 | ||
103 | LIBBB_MSRC6:=$(srcdir)/llist.c | 103 | LIBBB_MSRC6:=$(srcdir)/llist.c |
104 | LIBBB_MOBJ6:=llist_add_to.o llist_add_to_end.o llist_free_one.o llist_free.o | 104 | LIBBB_MOBJ6:=llist_add_to.o llist_add_to_end.o llist_pop.o llist_free.o |
105 | LIBBB_MOBJ6:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ6)) | 105 | LIBBB_MOBJ6:=$(patsubst %,$(LIBBB_DIR)/%, $(LIBBB_MOBJ6)) |
106 | $(LIBBB_MOBJ6):$(LIBBB_MSRC6) | 106 | $(LIBBB_MOBJ6):$(LIBBB_MSRC6) |
107 | $(compile.c) -DL_$(notdir $*) | 107 | $(compile.c) -DL_$(notdir $*) |
diff --git a/libbb/correct_password.c b/libbb/correct_password.c index bb9e7d3cc..527b3100b 100644 --- a/libbb/correct_password.c +++ b/libbb/correct_password.c | |||
@@ -72,6 +72,6 @@ int correct_password ( const struct passwd *pw ) | |||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
74 | encrypted = crypt ( unencrypted, correct ); | 74 | encrypted = crypt ( unencrypted, correct ); |
75 | memset ( unencrypted, 0, bb_strlen ( unencrypted )); | 75 | memset ( unencrypted, 0, strlen ( unencrypted )); |
76 | return ( strcmp ( encrypted, correct ) == 0 ) ? 1 : 0; | 76 | return ( strcmp ( encrypted, correct ) == 0 ) ? 1 : 0; |
77 | } | 77 | } |
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index f1f988f80..9b9081e26 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c | |||
@@ -174,15 +174,6 @@ void bb_xfflush_stdout(void) | |||
174 | } | 174 | } |
175 | #endif | 175 | #endif |
176 | 176 | ||
177 | // GCC forces inlining of strlen everywhere, which is generally a byte | ||
178 | // larger than calling a function, and it's called a lot so it adds up. | ||
179 | #ifdef L_strlen | ||
180 | size_t bb_strlen(const char *string) | ||
181 | { | ||
182 | return(__builtin_strlen(string)); | ||
183 | } | ||
184 | #endif | ||
185 | |||
186 | /* END CODE */ | 177 | /* END CODE */ |
187 | /* | 178 | /* |
188 | Local Variables: | 179 | Local Variables: |
diff --git a/loginutils/login.c b/loginutils/login.c index 277fc98ee..88123c0aa 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -338,7 +338,7 @@ static int check_tty ( const char *tty ) | |||
338 | 338 | ||
339 | if (( fp = fopen ( bb_path_securetty_file, "r" ))) { | 339 | if (( fp = fopen ( bb_path_securetty_file, "r" ))) { |
340 | while ( fgets ( buf, sizeof( buf ) - 1, fp )) { | 340 | while ( fgets ( buf, sizeof( buf ) - 1, fp )) { |
341 | for ( i = bb_strlen( buf ) - 1; i >= 0; --i ) { | 341 | for ( i = strlen( buf ) - 1; i >= 0; --i ) { |
342 | if ( !isspace ( buf[i] )) | 342 | if ( !isspace ( buf[i] )) |
343 | break; | 343 | break; |
344 | } | 344 | } |
diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 32a37ce17..2925dd28d 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c | |||
@@ -283,7 +283,7 @@ static void include_conf ( struct dep_t **first, struct dep_t **current, char *b | |||
283 | if ( p ) | 283 | if ( p ) |
284 | *p = 0; | 284 | *p = 0; |
285 | 285 | ||
286 | l = bb_strlen ( buffer ); | 286 | l = strlen ( buffer ); |
287 | 287 | ||
288 | while ( l && isspace ( buffer [l-1] )) { | 288 | while ( l && isspace ( buffer [l-1] )) { |
289 | buffer [l-1] = 0; | 289 | buffer [l-1] = 0; |
@@ -399,7 +399,7 @@ static struct dep_t *build_dep ( void ) | |||
399 | free(filename); | 399 | free(filename); |
400 | 400 | ||
401 | while ( reads ( fd, buffer, sizeof( buffer ))) { | 401 | while ( reads ( fd, buffer, sizeof( buffer ))) { |
402 | int l = bb_strlen ( buffer ); | 402 | int l = strlen ( buffer ); |
403 | char *p = 0; | 403 | char *p = 0; |
404 | 404 | ||
405 | while ( l > 0 && isspace ( buffer [l-1] )) { | 405 | while ( l > 0 && isspace ( buffer [l-1] )) { |
diff --git a/networking/arping.c b/networking/arping.c index 721368273..303e49935 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -293,7 +293,7 @@ int arping_main(int argc, char **argv) | |||
293 | if (opt & 128) /* timeout */ | 293 | if (opt & 128) /* timeout */ |
294 | timeout = atoi(_timeout); | 294 | timeout = atoi(_timeout); |
295 | if (opt & 256) { /* interface */ | 295 | if (opt & 256) { /* interface */ |
296 | if (bb_strlen(_device) > IF_NAMESIZE) { | 296 | if (strlen(_device) > IF_NAMESIZE) { |
297 | bb_error_msg_and_die("Interface name `%s' must be less than %d", | 297 | bb_error_msg_and_die("Interface name `%s' must be less than %d", |
298 | _device, IF_NAMESIZE); | 298 | _device, IF_NAMESIZE); |
299 | } | 299 | } |
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); |
diff --git a/procps/sysctl.c b/procps/sysctl.c index 850cbae67..125f13207 100644 --- a/procps/sysctl.c +++ b/procps/sysctl.c | |||
@@ -146,7 +146,7 @@ int sysctl_preload_file(const char *filename, int output) | |||
146 | if (*ptr == '#' || *ptr == ';') | 146 | if (*ptr == '#' || *ptr == ';') |
147 | continue; | 147 | continue; |
148 | 148 | ||
149 | if (bb_strlen(ptr) < 2) | 149 | if (strlen(ptr) < 2) |
150 | continue; | 150 | continue; |
151 | 151 | ||
152 | name = strtok(ptr, "="); | 152 | name = strtok(ptr, "="); |
@@ -323,7 +323,7 @@ int sysctl_display_all(const char *path, int output, int show_table) | |||
323 | sysctl_display_all(tmpdir, output, show_table); | 323 | sysctl_display_all(tmpdir, output, show_table); |
324 | } else | 324 | } else |
325 | retval |= | 325 | retval |= |
326 | sysctl_read_setting(tmpdir + bb_strlen(PROC_PATH), | 326 | sysctl_read_setting(tmpdir + strlen(PROC_PATH), |
327 | output); | 327 | output); |
328 | 328 | ||
329 | } | 329 | } |
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c index 5992d8420..2fe57b2fc 100644 --- a/util-linux/hwclock.c +++ b/util-linux/hwclock.c | |||
@@ -109,7 +109,7 @@ static int show_clock(int utc) | |||
109 | 109 | ||
110 | safe_strncpy ( buffer, ctime ( &t ), 64); | 110 | safe_strncpy ( buffer, ctime ( &t ), 64); |
111 | if ( buffer [0] ) | 111 | if ( buffer [0] ) |
112 | buffer [bb_strlen ( buffer ) - 1] = 0; | 112 | buffer [strlen ( buffer ) - 1] = 0; |
113 | 113 | ||
114 | //printf ( "%s %.6f seconds %s\n", buffer, 0.0, utc ? "" : ( ptm-> tm_isdst ? tzname [1] : tzname [0] )); | 114 | //printf ( "%s %.6f seconds %s\n", buffer, 0.0, utc ? "" : ( ptm-> tm_isdst ? tzname [1] : tzname [0] )); |
115 | printf ( "%s %.6f seconds\n", buffer, 0.0 ); | 115 | printf ( "%s %.6f seconds\n", buffer, 0.0 ); |
@@ -157,7 +157,7 @@ static int check_utc(void) | |||
157 | RESERVE_CONFIG_BUFFER(buffer, 128); | 157 | RESERVE_CONFIG_BUFFER(buffer, 128); |
158 | 158 | ||
159 | while ( fgets ( buffer, sizeof( buffer ), f )) { | 159 | while ( fgets ( buffer, sizeof( buffer ), f )) { |
160 | int len = bb_strlen ( buffer ); | 160 | int len = strlen ( buffer ); |
161 | 161 | ||
162 | while ( len && isspace ( buffer [len - 1] )) | 162 | while ( len && isspace ( buffer [len - 1] )) |
163 | len--; | 163 | len--; |