aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-07-19 20:54:29 -0500
committerRob Landley <rob@landley.net>2014-07-19 20:54:29 -0500
commit87c06e15329a0ef39385408a2e41be82e56a5418 (patch)
treeabba0e8e695e94a537bec57bb5d55d4627fa52ee
parenta873444aa3e57d05c639c849a41a2add146f0309 (diff)
downloadtoybox-87c06e15329a0ef39385408a2e41be82e56a5418.tar.gz
find needs "c" suffix to -size.
-rw-r--r--lib/lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 52675d56..bda69931 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -236,13 +236,13 @@ struct string_list *find_in_path(char *path, char *filename)
// (zetta and yotta don't fit in 64 bits.)
long atolx(char *numstr)
{
- char *c, *suffixes="bkmgtpe", *end;
+ char *c, *suffixes="cbkmgtpe", *end;
long val = strtol(numstr, &c, 0);
if (*c) {
if (c != numstr && (end = strchr(suffixes, tolower(*c)))) {
- int shift = end-suffixes;
- if (shift--) val *= 1024L<<(shift*10);
+ int shift = end-suffixes-2;
+ if (shift >= 0) val *= 1024L<<(shift*10);
} else {
while (isspace(*c)) c++;
if (*c) error_exit("not integer: %s", numstr);