diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-16 23:48:13 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-16 23:48:13 +0000 |
commit | a597aaddfa76d589d3e1a37b1f1c3401c2decffd (patch) | |
tree | 1db4966ffc99ad3c495bd18d6f7040e1515e79d7 /libbb/xatonum_template.c | |
parent | 3469c185e50e7bb672ce33ab5e50da753f0f0e20 (diff) | |
download | busybox-w32-a597aaddfa76d589d3e1a37b1f1c3401c2decffd.tar.gz busybox-w32-a597aaddfa76d589d3e1a37b1f1c3401c2decffd.tar.bz2 busybox-w32-a597aaddfa76d589d3e1a37b1f1c3401c2decffd.zip |
s/extern inline/static ATTRIBUTE_ALWAYS_INLINE/g
xstrtou: disallow leading '+'
Diffstat (limited to 'libbb/xatonum_template.c')
-rw-r--r-- | libbb/xatonum_template.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 | } |