OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf6a235
)
factor shouldn't give incorrect answers for >64-bit integers.
author
Elliott Hughes
<enh@google.com>
Sat, 13 May 2017 19:48:35 +0000
(12:48 -0700)
committer
Rob Landley
<rob@landley.net>
Mon, 15 May 2017 04:21:34 +0000
(23:21 -0500)
toys/other/factor.c
patch
|
blob
|
history
diff --git
a/toys/other/factor.c
b/toys/other/factor.c
index
0e07d71
..
f0e69c5
100644
(file)
--- 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;