aboutsummaryrefslogtreecommitdiffstats
path: root/capture_loop.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-12-29 00:51:29 +0000
committerGuy Harris <guy@alum.mit.edu>2004-12-29 00:51:29 +0000
commit85a6bea56ece48ef170158ab58bfcc19da5044d9 (patch)
tree38435c319cfb6d9b1f3a8d60e2b48e050f3e549d /capture_loop.c
parenta16a9d20968515f28766de0b479e9f23363df58e (diff)
Use the "errmsg_len" argument to "capture_loop_open_output()" -
"sizeof(errmsg)', when "errmsg" is a "char *", doesn't give the size of the string to which "errmsg" points, it gives the size of the pointer itself, which is too small. svn path=/trunk/; revision=12851
Diffstat (limited to 'capture_loop.c')
-rw-r--r--capture_loop.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/capture_loop.c b/capture_loop.c
index 4537ee93ee..4670f4be3c 100644
--- a/capture_loop.c
+++ b/capture_loop.c
@@ -788,7 +788,7 @@ static int capture_loop_open_output(loop_data *ld, char *errmsg, int errmsg_len)
ld->wtap_linktype = wtap_pcap_encap_to_wtap_encap(pcap_encap);
if (ld->wtap_linktype == WTAP_ENCAP_UNKNOWN) {
- g_snprintf(errmsg, sizeof errmsg,
+ g_snprintf(errmsg, errmsg_len,
"The network you're capturing from is of a type"
" that Ethereal doesn't support (data link type %d).", pcap_encap);
return FALSE;
@@ -817,12 +817,12 @@ static int capture_loop_open_output(loop_data *ld, char *errmsg, int errmsg_len)
default:
if (err < 0) {
- g_snprintf(errmsg, sizeof(errmsg),
+ g_snprintf(errmsg, errmsg_len,
"The file to which the capture would be"
" saved (\"%s\") could not be opened: Error %d.",
cfile.save_file, err);
} else {
- g_snprintf(errmsg, sizeof(errmsg),
+ g_snprintf(errmsg, errmsg_len,
"The file to which the capture would be"
" saved (\"%s\") could not be opened: %s.",
cfile.save_file, strerror(err));