projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
board_f: Drop unused headers
[platform/kernel/u-boot.git]
/
lib
/
strto.c
diff --git
a/lib/strto.c
b/lib/strto.c
index
a6c0157
..
e93a4f5
100644
(file)
--- a/
lib/strto.c
+++ b/
lib/strto.c
@@
-160,9
+160,11
@@
long trailing_strtoln(const char *str, const char *end)
if (!end)
end = str + strlen(str);
if (!end)
end = str + strlen(str);
- for (p = end - 1; p > str; p--) {
- if (!isdigit(*p))
- return simple_strtoul(p + 1, NULL, 10);
+ if (isdigit(end[-1])) {
+ for (p = end - 1; p > str; p--) {
+ if (!isdigit(*p))
+ return simple_strtoul(p + 1, NULL, 10);
+ }
}
return -1;
}
return -1;