Mercurial > hg > toybox
changeset 1394:9dbfd5390b92 draft
find needs "c" suffix to -size.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 19 Jul 2014 20:54:29 -0500 |
parents | 3e8ab37a4b60 |
children | 5149632b0d07 |
files | lib/lib.c |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/lib.c Fri Jul 18 18:31:41 2014 -0500 +++ b/lib/lib.c Sat Jul 19 20:54:29 2014 -0500 @@ -236,13 +236,13 @@ // (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);