From 32085a88e89ca64d2287465a75eac5885f248a8d Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 8 Dec 2004 04:00:26 +0000 Subject: [PATCH] cosmetic fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2176 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/utils.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.39.5