From: Chris Allegretta Date: Sun, 13 Jan 2013 08:37:54 +0000 (+0000) Subject: 2013-01-13 Chris Allegretta X-Git-Tag: v2.3.2~7 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b7a2dfb2da79c68a5353762fa7b6a8227a792aa3;p=nano.git 2013-01-13 Chris Allegretta * src/utils.c (parse_num): Initalize errno before calling strtol(). Fixes issue where trying to go to a line number too long will break legitimate goto-lines for the remainder of the editing session, reported by Joshua Rogers. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4563 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index b3c2eafe..af77bda6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2013-01-02 Mike Frysinger +2013-01-13 Chris Allegretta + * src/utils.c (parse_num): Initalize errno before calling strtol(). Fixes issue + where trying to go to a line number too long will break legitimate goto-lines + for the remainder of the editing session, reported by Joshua Rogers. + +2013-01-09 Mike Frysinger * configure.ac: Check for ncursesw5-config and base $CPPFLAGS based on it. 2013-01-09 Fabian Groffen diff --git a/src/utils.c b/src/utils.c index 220204ac..044488af 100644 --- a/src/utils.c +++ b/src/utils.c @@ -72,6 +72,10 @@ bool parse_num(const char *str, ssize_t *val) assert(str != NULL); + /* Man page for strtol() says this is required, and + it looks like it is! */ + errno = 0; + j = (ssize_t)strtol(str, &first_error, 10); if (errno == ERANGE || *str == '\0' || *first_error != '\0')