diff --git a/ChangeLog b/ChangeLog index 9a6f000960d52eb9aaa1a77ce5d6072949e15098..a07272e9b4a40d286bd4012fd97ebac6a78e738e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -224,6 +224,9 @@ CVS code - the text of the spell-checked file into its own function, replace_buffer(). (DLR) - utils.c: + ngetdelim() + - Do sanity checks in an assert instead of checking them + manually and returning -1 if they fail. (DLR) is_whole_word() - Only include when DISABLE_SPELLER isn't defined, as it's only used then. (DLR) diff --git a/src/utils.c b/src/utils.c index 880e8be3392d423a20a48de98a37ca41cf695e44..a7ffc746e6616c0fb108f056aba12cc7d68394c7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -199,8 +199,7 @@ ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream) int c; /* Sanity checks. */ - if (lineptr == NULL || n == NULL || stream == NULL) - return -1; + assert(lineptr != NULL && n != NULL && stream != NULL); /* Allocate the line the first time. */ if (*lineptr == NULL) {