aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/toshiba.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-18 07:04:29 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-11-18 07:04:29 +0000
commit0a54cb65c55f89e3763a9c37c0837ba4aa6c03a2 (patch)
tree93544364c5238f6d9567f51a4df3735d5afe790a /wiretap/toshiba.c
parent29d3e154f374c1ec4103b77e0245893fd8991995 (diff)
Fixed the checking of the return value from file_gets() (fgets()).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1053 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/toshiba.c')
-rw-r--r--wiretap/toshiba.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/toshiba.c b/wiretap/toshiba.c
index 9fa28847ef..924176dcc7 100644
--- a/wiretap/toshiba.c
+++ b/wiretap/toshiba.c
@@ -1,6 +1,6 @@
/* toshiba.c
*
- * $Id: toshiba.c,v 1.4 1999/11/11 19:19:17 gram Exp $
+ * $Id: toshiba.c,v 1.5 1999/11/18 07:04:29 gram Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -149,7 +149,7 @@ static gboolean toshiba_check_file_type(wtap *wth)
buf[TOSHIBA_LINE_LENGTH-1] = 0;
for (line = 0; line < TOSHIBA_HEADER_LINES_TO_CHECK; line++) {
- if (file_gets(buf, TOSHIBA_LINE_LENGTH, wth->fh) >= 0) {
+ if (file_gets(buf, TOSHIBA_LINE_LENGTH, wth->fh) != NULL) {
reclen = strlen(buf);
if (reclen < TOSHIBA_HDR_MAGIC_SIZE) {
@@ -263,7 +263,7 @@ parse_toshiba_rec_hdr(wtap *wth, FILE *fh, int *err)
* summary information for a packet. Read in that line and
* extract the useful information
*/
- if (file_gets(line, TOSHIBA_LINE_LENGTH, fh) < 0) {
+ if (file_gets(line, TOSHIBA_LINE_LENGTH, fh) == NULL) {
*err = file_error(fh);
if (*err == 0) {
*err = WTAP_ERR_SHORT_READ;
@@ -284,7 +284,7 @@ parse_toshiba_rec_hdr(wtap *wth, FILE *fh, int *err)
/* The next line contains mostly junk, but it does contain the
* packet length. */
- if (file_gets(line, TOSHIBA_LINE_LENGTH, fh) < 0) {
+ if (file_gets(line, TOSHIBA_LINE_LENGTH, fh) == NULL) {
*err = file_error(fh);
if (*err == 0) {
*err = WTAP_ERR_SHORT_READ;
@@ -334,7 +334,7 @@ parse_toshiba_hex_dump(FILE *fh, int pkt_len, guint8* buf, int *err)
hex_lines = pkt_len / 16 + ((pkt_len % 16) ? 1 : 0);
for (i = 0; i < hex_lines; i++) {
- if (file_gets(line, TOSHIBA_LINE_LENGTH, fh) < 0) {
+ if (file_gets(line, TOSHIBA_LINE_LENGTH, fh) == NULL) {
*err = file_error(fh);
if (*err == 0) {
*err = WTAP_ERR_SHORT_READ;