diff --git a/ChangeLog b/ChangeLog index b3c2eafef89dbf158d7324ffca48a8005192131f..af77bda63879855a3a79d34d330ff86d06694171 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2013-01-02 Mike Frysinger <vapier@gentoo.org> +2013-01-13 Chris Allegretta <chrisa@asty.org> + * 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 <vapier@gentoo.org> * configure.ac: Check for ncursesw5-config and base $CPPFLAGS based on it. 2013-01-09 Fabian Groffen <grobian@Savannah> diff --git a/src/utils.c b/src/utils.c index 220204ac709a0e0a8468862558ef49be90d15a04..044488af33accc3e48814b4618b172384ca035af 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')