diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/column-utils.c | 22 | ||||
-rw-r--r-- | epan/expert.c | 4 |
2 files changed, 7 insertions, 19 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index a3bfe87ecc..a4a9cf9a24 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -25,10 +25,6 @@ #include <string.h> #include <time.h> -#ifdef _WIN32 -#include <strsafe.h> -#endif - #include "column-utils.h" #include "timestamp.h" #include "to_str.h" @@ -45,7 +41,9 @@ #include <epan/strutil.h> #include <epan/epan.h> #include <epan/dfilter/dfilter.h> + #include <wsutil/utf8_entities.h> +#include <wsutil/ws_printf.h> #ifdef HAVE_LUA #include <epan/wslua/wslua.h> @@ -445,21 +443,9 @@ col_snprint_port(gchar *buf, gulong buf_siz, port_type typ, guint16 val) if (gbl_resolv_flags.transport_name && (str = try_serv_name_lookup(typ, val)) != NULL) { -/* - * I'm not sure what GLib is doing on Windows, but according to the VS 2013 - * profiler StringCchPrintf does it in 100x fewer samples. - */ -#ifdef _WIN32 - StringCchPrintfA(buf, buf_siz, "%s(%hu)", str, val); -#else - g_snprintf(buf, buf_siz, "%s(%"G_GUINT16_FORMAT")", str, val); -#endif + ws_snprintf(buf, buf_siz, "%s(%"G_GUINT16_FORMAT")", str, val); } else { -#ifdef _WIN32 - StringCchPrintfA(buf, buf_siz, "%hu", val); -#else - g_snprintf(buf, buf_siz, "%"G_GUINT16_FORMAT, val); -#endif + ws_snprintf(buf, buf_siz, "%"G_GUINT16_FORMAT, val); } } diff --git a/epan/expert.c b/epan/expert.c index b45541da2e..75e5981978 100644 --- a/epan/expert.c +++ b/epan/expert.c @@ -27,6 +27,8 @@ #include <stdio.h> #include <stdlib.h> +#include <wsutil/ws_printf.h> + #include "packet.h" #include "expert.h" #include "uat.h" @@ -539,7 +541,7 @@ expert_set_info_vformat(packet_info *pinfo, proto_item *pi, int group, int sever } if (use_vaformat) { - g_vsnprintf(formatted, ITEM_LABEL_LENGTH, format, ap); + ws_vsnprintf(formatted, ITEM_LABEL_LENGTH, format, ap); } else { g_strlcpy(formatted, format, ITEM_LABEL_LENGTH); } |