commit | dfef8549d68ceb1b17ac771e0ab7e99c08a92be1 | [log] [tgz] |
---|---|---|
author | Robert Swiecki <swiecki@google.com> | Tue Sep 13 18:06:46 2016 +0200 |
committer | Robert Swiecki <swiecki@google.com> | Tue Sep 13 18:06:46 2016 +0200 |
tree | 7bb213eda7f72e36808ce653c68bbf2cfa58dba6 | |
parent | fe8d289aeb2acb18849185fe01940e3f20cdac22 [diff] [blame] |
Trim \n at the end of dictionary inputs
diff --git a/files.c b/files.c index 1d37170..2d0e2b8 100644 --- a/files.c +++ b/files.c
@@ -279,6 +279,10 @@ if (getdelim(&lineptr, &n, '\n', fDict) == -1) { break; } + size_t len = strlen(lineptr); + if (len > 1 && lineptr[len - 1] == '\n') { + lineptr[len - 1] = '\0'; + } if ((hfuzz->dictionary = util_Realloc(hfuzz->dictionary, (hfuzz->dictionaryCnt + 1) * sizeof(hfuzz->dictionary[0]))) == NULL) {