aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-10-31 10:30:17 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-10-31 10:30:17 +0000
commitee2b7fd393064d7f48bb4867696f3288782ba6b9 (patch)
treead58bc01b508fe6803d76703aad31bd4a3ac0070
parent8608c8f1ded10fbaee00ff90d1fe7ca90b266629 (diff)
Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26642
-rw-r--r--capture-pcap-util-unix.c2
-rw-r--r--capture_opts.c4
-rw-r--r--file.c4
-rw-r--r--tap-protohierstat.c2
4 files changed, 5 insertions, 7 deletions
diff --git a/capture-pcap-util-unix.c b/capture-pcap-util-unix.c
index 2ecfa3757f..c1a6720a00 100644
--- a/capture-pcap-util-unix.c
+++ b/capture-pcap-util-unix.c
@@ -359,7 +359,7 @@ get_runtime_pcap_version(GString *str)
{
g_string_append_printf(str, "with ");
#ifdef HAVE_PCAP_LIB_VERSION
- g_string_append_printf(str, pcap_lib_version());
+ g_string_append(str, pcap_lib_version());
#else
g_string_append(str, "libpcap (version unknown)");
#endif
diff --git a/capture_opts.c b/capture_opts.c
index be35d9743a..266312beef 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -669,7 +669,7 @@ capture_opts_list_interfaces(gboolean machine_readable)
case AT_IPv4:
if (inet_ntop(AF_INET, &if_addr->ip_addr.ip4_addr, addr_str,
ADDRSTRLEN)) {
- printf(addr_str);
+ printf("%s", addr_str);
} else {
printf("<unknown IPv4>");
}
@@ -677,7 +677,7 @@ capture_opts_list_interfaces(gboolean machine_readable)
case AT_IPv6:
if (inet_ntop(AF_INET6, &if_addr->ip_addr.ip6_addr,
addr_str, ADDRSTRLEN)) {
- printf(addr_str);
+ printf("%s", addr_str);
} else {
printf("<unknown IPv6>");
}
diff --git a/file.c b/file.c
index f4415cdd0a..3f8bda870c 100644
--- a/file.c
+++ b/file.c
@@ -403,7 +403,6 @@ cf_read(capture_file *cf)
const gchar *name_ptr;
const char *errmsg;
char errmsg_errno[1024+1];
- gchar err_str[2048+1];
gint64 data_offset;
progdlg_t *volatile progbar = NULL;
gboolean stop_flag;
@@ -627,8 +626,7 @@ cf_read(capture_file *cf)
errmsg = errmsg_errno;
break;
}
- g_snprintf(err_str, sizeof err_str, errmsg);
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, err_str);
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", errmsg);
return CF_READ_ERROR;
} else
return CF_READ_OK;
diff --git a/tap-protohierstat.c b/tap-protohierstat.c
index 7f897b930a..29ef508218 100644
--- a/tap-protohierstat.c
+++ b/tap-protohierstat.c
@@ -152,7 +152,7 @@ phs_draw(phs_t *rs, int indentation)
}
stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, " ");
}
- stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, rs->proto_name);
+ stroff+=g_snprintf(str+stroff, MAXPHSLINE-stroff, "%s", rs->proto_name);
printf("%-40s frames:%d bytes:%" G_GINT64_MODIFIER "d\n",str, rs->frames, rs->bytes);
phs_draw(rs->child, indentation+1);
}