diff --git a/src/util-threshold-config.c b/src/util-threshold-config.c index 39be1b0ff2..a4c1d5c60e 100644 --- a/src/util-threshold-config.c +++ b/src/util-threshold-config.c @@ -606,13 +606,16 @@ int SCThresholdConfLineIsMultiline(char *line) * \retval int of the line length */ int SCThresholdConfLineLength(FILE *fd) { - int pos = ftell(fd); + long pos = ftell(fd); int len = 0; char c; while ( (c = fgetc(fd)) && c != '\n' && !feof(fd)) len++; + if (pos < 0) + pos = 0; + fseek(fd, pos, SEEK_SET); return len; }