]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - lib/strto.c
arm: imx6q: Add Engicam i.CoreM6 Solo/Duallite RQS Starter Kit initial support
[people/ms/u-boot.git] / lib / strto.c
index a6c01574dac3f6994cc3121f5d15082ad44e5155..e93a4f5491c3263ae179f6430476996538026328 100644 (file)
@@ -160,9 +160,11 @@ long trailing_strtoln(const char *str, const char *end)
 
        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;