diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index a8c376a295f..c65d1c7134e 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -166,9 +166,10 @@ sethistsize(const char *hs) HistEvent he; if (hist != NULL) { - if (hs == NULL || *hs == '\0' || - (histsize = atoi(hs)) < 0) + if (hs == NULL || !is_number(hs)) histsize = 100; + else + histsize = atoi(hs); history(hist, &he, H_SETSIZE, histsize); history(hist, &he, H_SETUNIQUE, 1); }