1
1

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.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4563 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
Chris Allegretta 2013-01-13 08:37:54 +00:00
родитель f4e26d174e
Коммит b7a2dfb2da
2 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -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>

Просмотреть файл

@ -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')