aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-08 11:44:03 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-08 18:44:30 +0000
commit70ba2f88d1e9ebab3c535d5e787d7172ca665c9f (patch)
tree9464f4dcfdfd279a1c09cc38f2bd15d6302a3b53
parent5c0a3beee28382070bd21ba80f8ddde0be5db311 (diff)
Set err_info to null for errors that don't have an informaton string.
Change-Id: Ibbcf3496ebfb20c53b953db84b2ddb69083dcb86 Reviewed-on: https://code.wireshark.org/review/4556 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--rawshark.c2
-rw-r--r--wiretap/file_wrappers.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/rawshark.c b/rawshark.c
index 3e9a0da992..901187bed4 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -966,12 +966,12 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, const gchar **err
bytes_read = read(fd, ptr, (int)bytes_needed);
if (bytes_read == 0) {
*err = WTAP_ERR_SHORT_READ;
- *err_info = "Got zero bytes reading data from pipe";
return FALSE;
} else if (bytes_read < 0) {
*err = errno;
return FALSE;
}
+ *err_info = NULL;
bytes_needed -= bytes_read;
*data_offset += bytes_read;
ptr += bytes_read;
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c
index 667727346e..d0a28e3d98 100644
--- a/wiretap/file_wrappers.c
+++ b/wiretap/file_wrappers.c
@@ -1364,7 +1364,8 @@ file_error(FILE_T fh, gchar **err_info)
if (fh->err!=0 && err_info) {
/* g_strdup() returns NULL for NULL argument */
*err_info = g_strdup(fh->err_info);
- }
+ } else
+ *err_info = NULL;
return fh->err;
}