diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-16 23:48:13 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-16 23:48:13 +0000 |
commit | b0ba03e9b3d460154fd09ef5676c18bf0770fdce (patch) | |
tree | 1db4966ffc99ad3c495bd18d6f7040e1515e79d7 /libbb | |
parent | 13fadcb7fbac1e7b95cf2de2dff28b2d547a40c1 (diff) | |
download | busybox-w32-b0ba03e9b3d460154fd09ef5676c18bf0770fdce.tar.gz busybox-w32-b0ba03e9b3d460154fd09ef5676c18bf0770fdce.tar.bz2 busybox-w32-b0ba03e9b3d460154fd09ef5676c18bf0770fdce.zip |
s/extern inline/static ATTRIBUTE_ALWAYS_INLINE/g
xstrtou: disallow leading '+'
git-svn-id: svn://busybox.net/trunk/busybox@16976 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/getopt32.c | 2 | ||||
-rw-r--r-- | libbb/xatonum.c | 3 | ||||
-rw-r--r-- | libbb/xatonum_template.c | 6 |
3 files changed, 5 insertions, 6 deletions
diff --git a/libbb/getopt32.c b/libbb/getopt32.c index dddf8121a..50343fdab 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c | |||
@@ -447,7 +447,6 @@ getopt32(int argc, char **argv, const char *applet_opts, ...) | |||
447 | } | 447 | } |
448 | va_end (p); | 448 | va_end (p); |
449 | 449 | ||
450 | #if ENABLE_AR || ENABLE_TAR | ||
451 | if (spec_flgs & FIRST_ARGV_IS_OPT) { | 450 | if (spec_flgs & FIRST_ARGV_IS_OPT) { |
452 | if (argv[1] && argv[1][0] != '-' && argv[1][0] != '\0') { | 451 | if (argv[1] && argv[1][0] != '-' && argv[1][0] != '\0') { |
453 | argv[1] = xasprintf("-%s", argv[1]); | 452 | argv[1] = xasprintf("-%s", argv[1]); |
@@ -455,7 +454,6 @@ getopt32(int argc, char **argv, const char *applet_opts, ...) | |||
455 | spec_flgs |= FREE_FIRST_ARGV_IS_OPT; | 454 | spec_flgs |= FREE_FIRST_ARGV_IS_OPT; |
456 | } | 455 | } |
457 | } | 456 | } |
458 | #endif | ||
459 | /* Note: just "getopt() <= 0" will not work good for | 457 | /* Note: just "getopt() <= 0" will not work good for |
460 | * "fake" short options, like this one: | 458 | * "fake" short options, like this one: |
461 | * wget $'-\203' "Test: test" http://kernel.org/ | 459 | * wget $'-\203' "Test: test" http://kernel.org/ |
diff --git a/libbb/xatonum.c b/libbb/xatonum.c index 35607c317..dec3c2dc4 100644 --- a/libbb/xatonum.c +++ b/libbb/xatonum.c | |||
@@ -34,7 +34,8 @@ | |||
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #if UINT_MAX != ULONG_MAX | 36 | #if UINT_MAX != ULONG_MAX |
37 | extern inline unsigned bb_strtoui(const char *str, char **end, int b) | 37 | static ATTRIBUTE_ALWAYS_INLINE |
38 | unsigned bb_strtoui(const char *str, char **end, int b) | ||
38 | { | 39 | { |
39 | unsigned long v = strtoul(str, end, b); | 40 | unsigned long v = strtoul(str, end, b); |
40 | if (v > UINT_MAX) { | 41 | if (v > UINT_MAX) { |
diff --git a/libbb/xatonum_template.c b/libbb/xatonum_template.c index 53ba544eb..ce0199594 100644 --- a/libbb/xatonum_template.c +++ b/libbb/xatonum_template.c | |||
@@ -24,7 +24,7 @@ unsigned type xstrtou(_range_sfx)(const char *numstr, int base, | |||
24 | /* Disallow '-' and any leading whitespace. Speed isn't critical here | 24 | /* Disallow '-' and any leading whitespace. Speed isn't critical here |
25 | * since we're parsing commandline args. So make sure we get the | 25 | * since we're parsing commandline args. So make sure we get the |
26 | * actual isspace function rather than a lnumstrer macro implementaion. */ | 26 | * actual isspace function rather than a lnumstrer macro implementaion. */ |
27 | if ((*numstr == '-') || (isspace)(*numstr)) | 27 | if (*numstr == '-' || *numstr == '+' || (isspace)(*numstr)) |
28 | goto inval; | 28 | goto inval; |
29 | 29 | ||
30 | /* Since this is a lib function, we're not allowed to reset errno to 0. | 30 | /* Since this is a lib function, we're not allowed to reset errno to 0. |
@@ -36,7 +36,7 @@ unsigned type xstrtou(_range_sfx)(const char *numstr, int base, | |||
36 | /* Do the initial validity check. Note: The standards do not | 36 | /* Do the initial validity check. Note: The standards do not |
37 | * guarantee that errno is set if no digits were found. So we | 37 | * guarantee that errno is set if no digits were found. So we |
38 | * must test for this explicitly. */ | 38 | * must test for this explicitly. */ |
39 | if (errno || (numstr == e)) | 39 | if (errno || numstr == e) |
40 | goto inval; /* error / no digits / illegal trailing chars */ | 40 | goto inval; /* error / no digits / illegal trailing chars */ |
41 | 41 | ||
42 | errno = old_errno; /* Ok. So restore errno. */ | 42 | errno = old_errno; /* Ok. So restore errno. */ |
@@ -127,7 +127,7 @@ type xstrto(_range_sfx)(const char *numstr, int base, | |||
127 | type r; | 127 | type r; |
128 | const char *p = numstr; | 128 | const char *p = numstr; |
129 | 129 | ||
130 | if ((p[0] == '-') && (p[1] != '+')) { | 130 | if (p[0] == '-') { |
131 | ++p; | 131 | ++p; |
132 | ++u; /* two's complement */ | 132 | ++u; /* two's complement */ |
133 | } | 133 | } |