Fix potential small issue with ftell and fseek

remotes/origin/master-1.1.x
Gerardo Iglesias Galvan 15 years ago committed by Victor Julien
parent dd5e438d6f
commit c968ca0f85

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

Loading…
Cancel
Save