diff options
author | Elliott Hughes <enh@google.com> | 2017-05-13 12:48:35 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-05-14 23:21:34 -0500 |
commit | 57605d2b481a87af4ba444761ece592d441950b1 (patch) | |
tree | a44926c087be33da8a0e4c11d527cc64b4e5006e /toys/other | |
parent | cf6a235279e84028e8edd3e75f585cd6dbfa40d5 (diff) | |
download | toybox-57605d2b481a87af4ba444761ece592d441950b1.tar.gz |
factor shouldn't give incorrect answers for >64-bit integers.
Diffstat (limited to 'toys/other')
-rw-r--r-- | toys/other/factor.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/other/factor.c b/toys/other/factor.c index 0e07d714..f0e69c5d 100644 --- a/toys/other/factor.c +++ b/toys/other/factor.c @@ -29,8 +29,9 @@ static void factor(char *s) if (*s=='-') dash = *s++; if (!*s) return; + errno = 0; l = strtoull(s, &s, 0); - if (*s && !isspace(*s)) { + if (errno || (*s && !isspace(*s))) { error_msg("%s: not integer", err); while (*s && !isspace(*s)) s++; continue; |