Fix some "format not a string literal and no format arguments" warnings.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 31 Oct 2008 10:30:17 +0000 (10:30 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 31 Oct 2008 10:30:17 +0000 (10:30 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26642 f5534014-38df-0310-8fa8-9805f1628bb7

capture-pcap-util-unix.c
capture_opts.c
file.c
tap-protohierstat.c

index 2ecfa3757f9b1643880f45f24d9f454701432355..c1a6720a00c2a5a121c1877374bf3096be54c252 100644 (file)
@@ -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
index be35d9743a7b678e75e09f34ca52bf6893f0bfd6..266312beef8599645c62610c6c50712a73d812db 100644 (file)
@@ -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 f4415cdd0a117f9cb1d5836c7dbaed12ec728d1c..3f8bda870cca2c642d9b0289e18b53d85fce70da 100644 (file)
--- 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;
index 7f897b930aec45b560d24da17a79ad887850a34d..29ef5082188079c07388f1ed8f515f132daff728 100644 (file)
@@ -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);
        }