From c349e6f2e19281903fd8666cfeafe2f081fef66a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 10 Oct 2018 05:28:06 -0500 Subject: Trivial speedup to format_iso_time(), teach parsetime() leading garbage != 0. --- lib/xwrap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/xwrap.c') diff --git a/lib/xwrap.c b/lib/xwrap.c index 7276151f..2c3b6041 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -795,6 +795,7 @@ long xparsetime(char *arg, long units, long *fraction) long l; char *end; + if (*arg != '.' && !isdigit(*arg)) error_exit("bad %s", arg); if (CFG_TOYBOX_FLOAT) d = strtod(arg, &end); else l = strtoul(arg, &end, 10); -- cgit v1.2.3