wtap_file_read_till_separator() can return values other than 1 on success.
It returns the length of the string it read, so only treat 0 and -1 as errors. (0 either means "EOF" or "string is zero length", but this is only in the code that reads numbers, and a number needs at least 1 digit, so both EOF and "zero-length string" mean "this isn't a valid Peek tagged file".) Change-Id: Ib83eb2f1e53d912a2138be01480e2b464cf936db Reviewed-on: https://code.wireshark.org/review/4591 Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
parent
f5b06c5630
commit
7e49f06190
|
@ -199,7 +199,7 @@ static int wtap_file_read_number (wtap *wth, guint32 *num, int *err,
|
|||
|
||||
ret = wtap_file_read_till_separator (wth, str_num, sizeof (str_num)-1, "<",
|
||||
err, err_info);
|
||||
if (ret != 1) {
|
||||
if (ret == 0 || ret == -1) {
|
||||
/* 0 means EOF, which means "not a valid Peek tagged file";
|
||||
-1 means error, and "err" has been set. */
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue