From 85a6bea56ece48ef170158ab58bfcc19da5044d9 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 29 Dec 2004 00:51:29 +0000 Subject: 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 --- capture_loop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'capture_loop.c') 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)); -- cgit v1.2.3