From: David Lawrence Ramsey Date: Wed, 8 Dec 2004 04:00:26 +0000 (+0000) Subject: cosmetic fixes X-Git-Tag: v1.3.6~226 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=32085a88e89ca64d2287465a75eac5885f248a8d;p=nano.git cosmetic fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2176 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/utils.c b/src/utils.c index bda6ce74..950cb9e0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -101,11 +101,15 @@ bool parse_num(const char *str, ssize_t *val) ssize_t j; assert(str != NULL); + j = (ssize_t)strtol(str, &first_error, 10); + if (errno == ERANGE || *str == '\0' || *first_error != '\0') return FALSE; + if (val != NULL) *val = j; + return TRUE; }