Fix potential small issue with ftell and fseek.

remotes/origin/master-1.0.x
Victor Julien 15 years ago
parent 3e9e81a1ef
commit 95c1a21ae8

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