diff options
author | João Valverde <j@v6e.pt> | 2021-12-17 20:05:19 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2021-12-19 20:06:13 +0000 |
commit | fe5248717faa1c99a4d0c761fa8da63afffc5d3f (patch) | |
tree | 80dfeee421091a44c88f80b7a65edc0590e4b4e5 /ui | |
parent | c5a19582e4e18605e8528cd999221444f7ece318 (diff) |
Replace g_snprintf() with snprintf()
Use macros from inttypes.h with format strings.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/capture.c | 12 | ||||
-rw-r--r-- | ui/cli/tap-endpoints.c | 12 | ||||
-rw-r--r-- | ui/cli/tap-exportobject.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-follow.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-iostat.c | 26 | ||||
-rw-r--r-- | ui/cli/tap-iousers.c | 12 | ||||
-rw-r--r-- | ui/cli/tap-protohierstat.c | 8 | ||||
-rw-r--r-- | ui/cli/tap-rpcprogs.c | 4 | ||||
-rw-r--r-- | ui/cli/tap-rtp.c | 2 | ||||
-rw-r--r-- | ui/cli/tap-simple_stattable.c | 2 | ||||
-rw-r--r-- | ui/proto_hier_stats.c | 2 | ||||
-rw-r--r-- | ui/qt/follow_stream_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/qt/main.cpp | 16 | ||||
-rw-r--r-- | ui/qt/models/export_objects_model.cpp | 2 | ||||
-rw-r--r-- | ui/qt/sctp_chunk_statistics_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/qt/show_packet_bytes_dialog.cpp | 2 | ||||
-rw-r--r-- | ui/summary.c | 2 | ||||
-rw-r--r-- | ui/traffic_table_ui.c | 4 |
18 files changed, 59 insertions, 59 deletions
diff --git a/ui/capture.c b/ui/capture.c index 5a5c6a2015..d627925847 100644 --- a/ui/capture.c +++ b/ui/capture.c @@ -307,7 +307,7 @@ cf_open_error_message(int err, gchar *err_info) break; case WTAP_ERR_UNSUPPORTED: - g_snprintf(errmsg_errno, sizeof(errmsg_errno), + snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" contains record data that Wireshark doesn't support.\n" "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); @@ -319,7 +319,7 @@ cf_open_error_message(int err, gchar *err_info) break; case WTAP_ERR_BAD_FILE: - g_snprintf(errmsg_errno, sizeof(errmsg_errno), + snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" appears to be damaged or corrupt.\n" "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); @@ -336,7 +336,7 @@ cf_open_error_message(int err, gchar *err_info) break; case WTAP_ERR_DECOMPRESS: - g_snprintf(errmsg_errno, sizeof(errmsg_errno), + snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" cannot be decompressed; it may be damaged or corrupt.\n" "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); @@ -344,7 +344,7 @@ cf_open_error_message(int err, gchar *err_info) break; case WTAP_ERR_INTERNAL: - g_snprintf(errmsg_errno, sizeof(errmsg_errno), + snprintf(errmsg_errno, sizeof(errmsg_errno), "An internal error occurred opening the file \"%%s\".\n" "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); @@ -352,7 +352,7 @@ cf_open_error_message(int err, gchar *err_info) break; case WTAP_ERR_DECOMPRESSION_NOT_SUPPORTED: - g_snprintf(errmsg_errno, sizeof(errmsg_errno), + snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" cannot be decompressed; it is compressed in a way that We don't support.\n" "(%s)", err_info != NULL ? err_info : "no information supplied"); g_free(err_info); @@ -360,7 +360,7 @@ cf_open_error_message(int err, gchar *err_info) break; default: - g_snprintf(errmsg_errno, sizeof(errmsg_errno), + snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" could not be opened: %s.", wtap_strerror(err)); errmsg = errmsg_errno; diff --git a/ui/cli/tap-endpoints.c b/ui/cli/tap-endpoints.c index 690cdb1742..948ca242a1 100644 --- a/ui/cli/tap-endpoints.c +++ b/ui/cli/tap-endpoints.c @@ -71,9 +71,9 @@ endpoints_draw(void *arg) if (display_port) { /* XXX - TODO: make port resolution configurable (through gbl_resolv_flags?) */ port_str = get_conversation_port(NULL, host->port, host->etype, TRUE); - printf("%-20s %5s %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER - "u %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u %6" - G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u \n", + printf("%-20s %5s %6" PRIu64 " %9" PRIu64 + " %6" PRIu64 " %9" PRIu64 " %6" + PRIu64 " %9" PRIu64 " \n", conversation_str, port_str, host->tx_frames+host->rx_frames, host->tx_bytes+host->rx_bytes, @@ -81,9 +81,9 @@ endpoints_draw(void *arg) host->rx_frames, host->rx_bytes); wmem_free(NULL, port_str); } else { - printf("%-20s %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER - "u %6" G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u %6" - G_GINT64_MODIFIER "u %9" G_GINT64_MODIFIER "u \n", + printf("%-20s %6" PRIu64 " %9" PRIu64 + " %6" PRIu64 " %9" PRIu64 " %6" + PRIu64 " %9" PRIu64 " \n", /* XXX - TODO: make name resolution configurable (through gbl_resolv_flags?) */ conversation_str, host->tx_frames+host->rx_frames, host->tx_bytes+host->rx_bytes, diff --git a/ui/cli/tap-exportobject.c b/ui/cli/tap-exportobject.c index 6ce85cec62..d97f99e966 100644 --- a/ui/cli/tap-exportobject.c +++ b/ui/cli/tap-exportobject.c @@ -130,7 +130,7 @@ eo_draw(void *tapdata) char generic_name[EXPORT_OBJECT_MAXFILELEN+1]; const char *ext; ext = eo_ct2ext(entry->content_type); - g_snprintf(generic_name, sizeof(generic_name), + snprintf(generic_name, sizeof(generic_name), "object%u%s%s", entry->pkt_num, ext ? "." : "", ext ? ext : ""); safe_filename = eo_massage_str(generic_name, EXPORT_OBJECT_MAXFILELEN, count); diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c index 9203781800..865d91afde 100644 --- a/ui/cli/tap-follow.c +++ b/ui/cli/tap-follow.c @@ -116,7 +116,7 @@ static void follow_print_hex(const char *prefixp, guint32 offset, void *datap, i if ((ii % BYTES_PER_LINE) == 0) { /* new line */ - g_snprintf(line, LINE_LEN + 1, "%0*X", OFFSET_LEN, offset); + snprintf(line, LINE_LEN + 1, "%0*X", OFFSET_LEN, offset); memset(line + HEX_START - OFFSET_SPACE, ' ', HEX_LEN + OFFSET_SPACE + HEX_SPACE); diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index e45edcd3e0..b810ff0743 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -598,7 +598,7 @@ iostat_draw(void *arg) dur_nsecs = (int)(duration%G_GUINT64_CONSTANT(1000000)); dur_nsecs_orig = dur_nsecs; dur_mag = magnitude((guint64)dur_secs, 5); - g_snprintf(dur_mag_s, 3, "%u", dur_mag); + snprintf(dur_mag_s, 3, "%u", dur_mag); /* Calc the interval's magnitude */ invl_mag = magnitude(interval/G_GUINT64_CONSTANT(1000000), 5); @@ -678,7 +678,7 @@ iostat_draw(void *arg) fr_mag = MAX(6, fr_mag); col_w[j].fr = fr_mag; tabrow_w += col_w[j].fr + 3; - g_snprintf(fr_mag_s, 3, "%u", fr_mag); + snprintf(fr_mag_s, 3, "%u", fr_mag); if (type == CALC_TYPE_FRAMES) { fmt = g_strconcat(" %", fr_mag_s, "u |", NULL); @@ -689,8 +689,8 @@ iostat_draw(void *arg) val_mag = MAX(5, val_mag); col_w[j].val = val_mag; tabrow_w += (col_w[j].val + 3); - g_snprintf(val_mag_s, 3, "%u", val_mag); - fmt = g_strconcat(" %", fr_mag_s, "u |", " %", val_mag_s, G_GINT64_MODIFIER, "u |", NULL); + snprintf(val_mag_s, 3, "%u", val_mag); + fmt = g_strconcat(" %", fr_mag_s, "u |", " %", val_mag_s, PRIu64 " |", NULL); } if (fmt) fmts[j] = fmt; @@ -703,8 +703,8 @@ iostat_draw(void *arg) val_mag = magnitude(iot->max_vals[j], 15); val_mag = MAX(5, val_mag); col_w[j].val = val_mag; - g_snprintf(val_mag_s, 3, "%u", val_mag); - fmt = g_strconcat(" %", val_mag_s, G_GINT64_MODIFIER, "u |", NULL); + snprintf(val_mag_s, 3, "%u", val_mag); + fmt = g_strconcat(" %", val_mag_s, PRIu64 " |", NULL); break; default: @@ -713,7 +713,7 @@ iostat_draw(void *arg) case FT_FLOAT: case FT_DOUBLE: val_mag = magnitude(iot->max_vals[j], 15); - g_snprintf(val_mag_s, 3, "%u", val_mag); + snprintf(val_mag_s, 3, "%u", val_mag); fmt = g_strconcat(" %", val_mag_s, ".6f |", NULL); col_w[j].val = val_mag + 7; break; @@ -726,7 +726,7 @@ iostat_draw(void *arg) iot->max_vals[j] = (iot->max_vals[j] + G_GUINT64_CONSTANT(500000000)) / NANOSECS_PER_SEC; } val_mag = magnitude(iot->max_vals[j], 15); - g_snprintf(val_mag_s, 3, "%u", val_mag); + snprintf(val_mag_s, 3, "%u", val_mag); fmt = g_strconcat(" %", val_mag_s, "u.%06u |", NULL); col_w[j].val = val_mag + 7; break; @@ -735,7 +735,7 @@ iostat_draw(void *arg) val_mag = magnitude(iot->max_vals[j], 15); val_mag = MAX(namelen, val_mag); col_w[j].val = val_mag; - g_snprintf(val_mag_s, 3, "%u", val_mag); + snprintf(val_mag_s, 3, "%u", val_mag); switch (ftype) { case FT_UINT8: @@ -743,14 +743,14 @@ iostat_draw(void *arg) case FT_UINT24: case FT_UINT32: case FT_UINT64: - fmt = g_strconcat(" %", val_mag_s, G_GINT64_MODIFIER, "u |", NULL); + fmt = g_strconcat(" %", val_mag_s, PRIu64 " |", NULL); break; case FT_INT8: case FT_INT16: case FT_INT24: case FT_INT32: case FT_INT64: - fmt = g_strconcat(" %", val_mag_s, G_GINT64_MODIFIER, "d |", NULL); + fmt = g_strconcat(" %", val_mag_s, PRId64 " |", NULL); break; } } /* End of ftype switch */ @@ -810,7 +810,7 @@ iostat_draw(void *arg) spaces_s = &spaces[18 + dur_mag]; printf(full_fmt, (guint32)(interval/G_GUINT64_CONSTANT(1000000)), spaces_s); } else { - g_snprintf(invl_prec_s, 3, "%u", invl_prec); + snprintf(invl_prec_s, 3, "%u", invl_prec); invl_fmt = g_strconcat("%", dur_mag_s, "u.%0", invl_prec_s, "u", NULL); full_fmt = g_strconcat("| Duration: ", invl_fmt, " secs%s|\n", NULL); spaces_s = &spaces[19 + dur_mag + invl_prec]; @@ -1083,7 +1083,7 @@ iostat_draw(void *arg) int maxw; maxw = dur_mag >= 3 ? dur_mag+1 : 3; g_free(full_fmt); - g_snprintf(dur_mag_s, 3, "%u", maxw); + snprintf(dur_mag_s, 3, "%u", maxw); full_fmt = g_strconcat( dur_mag == 1 ? "| " : "| ", invl_fmt, " <> ", "%-", dur_mag_s, "s|", NULL); diff --git a/ui/cli/tap-iousers.c b/ui/cli/tap-iousers.c index c828a14ae0..af21fff5fb 100644 --- a/ui/cli/tap-iousers.c +++ b/ui/cli/tap-iousers.c @@ -111,9 +111,9 @@ iousers_draw(void *arg) dst_port = get_conversation_port(NULL, iui->dst_port, iui->etype, TRUE); src = wmem_strconcat(NULL, src_addr, ":", src_port, NULL); dst = wmem_strconcat(NULL, dst_addr, ":", dst_port, NULL); - printf("%-26s <-> %-26s %6" G_GINT64_MODIFIER "u %-9s" - " %6" G_GINT64_MODIFIER "u %-9s" - " %6" G_GINT64_MODIFIER "u %-9s ", + printf("%-26s <-> %-26s %6" PRIu64 " %-9s" + " %6" PRIu64 " %-9s" + " %6" PRIu64 " %-9s ", src, dst, iui->rx_frames, rx_bytes, iui->tx_frames, tx_bytes, @@ -125,9 +125,9 @@ iousers_draw(void *arg) wmem_free(NULL, src); wmem_free(NULL, dst); } else { - printf("%-20s <-> %-20s %6" G_GINT64_MODIFIER "u %-9s" - " %6" G_GINT64_MODIFIER "u %-9s" - " %6" G_GINT64_MODIFIER "u %-9s ", + printf("%-20s <-> %-20s %6" PRIu64 " %-9s" + " %6" PRIu64 " %-9s" + " %6" PRIu64 " %-9s ", src_addr, dst_addr, iui->rx_frames, rx_bytes, iui->tx_frames, tx_bytes, diff --git a/ui/cli/tap-protohierstat.c b/ui/cli/tap-protohierstat.c index 02bb57102e..d241ecb54e 100644 --- a/ui/cli/tap-protohierstat.c +++ b/ui/cli/tap-protohierstat.c @@ -129,13 +129,13 @@ phs_draw(phs_t *rs, int indentation) stroff = 0; for (i=0; i<indentation; i++) { if (i > 15) { - stroff += g_snprintf(str+stroff, MAXPHSLINE-stroff, "..."); + stroff += snprintf(str+stroff, MAXPHSLINE-stroff, "..."); break; } - stroff += g_snprintf(str+stroff, MAXPHSLINE-stroff, " "); + stroff += snprintf(str+stroff, MAXPHSLINE-stroff, " "); } - g_snprintf(str+stroff, MAXPHSLINE-stroff, "%s", rs->proto_name); - printf("%-40s frames:%u bytes:%" G_GINT64_MODIFIER "u\n", str, rs->frames, rs->bytes); + snprintf(str+stroff, MAXPHSLINE-stroff, "%s", rs->proto_name); + printf("%-40s frames:%u bytes:%" PRIu64 "\n", str, rs->frames, rs->bytes); phs_draw(rs->child, indentation+1); } } diff --git a/ui/cli/tap-rpcprogs.c b/ui/cli/tap-rpcprogs.c index a0de2ad8cf..834bb83a6e 100644 --- a/ui/cli/tap-rpcprogs.c +++ b/ui/cli/tap-rpcprogs.c @@ -184,8 +184,8 @@ rpcprogs_draw(void *dummy _U_) td = ((guint64)(rp->tot.secs)) * NANOSECS_PER_SEC + rp->tot.nsecs; td = ((td / rp->num) + 500) / 1000; - g_snprintf(str, sizeof(str), "%s(%d)", rpc_prog_name(rp->program), rp->program); - printf("%-15s %2u %6d %3d.%06d %3d.%06d %3" G_GINT64_MODIFIER "u.%06" G_GINT64_MODIFIER "u\n", + snprintf(str, sizeof(str), "%s(%d)", rpc_prog_name(rp->program), rp->program); + printf("%-15s %2u %6d %3d.%06d %3d.%06d %3" PRIu64 ".%06" PRIu64 "\n", str, rp->version, rp->num, diff --git a/ui/cli/tap-rtp.c b/ui/cli/tap-rtp.c index b449d9de73..b7937cd0d1 100644 --- a/ui/cli/tap-rtp.c +++ b/ui/cli/tap-rtp.c @@ -63,7 +63,7 @@ rtpstreams_stat_draw_cb(rtpstream_tapinfo_t *tapinfo _U_) /* save the current locale */ savelocale = g_strdup(setlocale(LC_NUMERIC, NULL)); /* switch to "C" locale to avoid problems with localized decimal separators - in g_snprintf("%f") functions */ + in snprintf("%f") functions */ setlocale(LC_NUMERIC, "C"); list = the_tapinfo_struct.strinfo_list; diff --git a/ui/cli/tap-simple_stattable.c b/ui/cli/tap-simple_stattable.c index 014d0c908a..74fe904a98 100644 --- a/ui/cli/tap-simple_stattable.c +++ b/ui/cli/tap-simple_stattable.c @@ -61,7 +61,7 @@ simple_draw(void *arg) if (field_data->type == TABLE_ITEM_NONE) /* Nothing for us here */ break; - g_snprintf(fmt_string, sizeof(fmt_string), "%s |", field->field_format); + snprintf(fmt_string, sizeof(fmt_string), "%s |", field->field_format); switch(field->type) { case TABLE_ITEM_UINT: diff --git a/ui/proto_hier_stats.c b/ui/proto_hier_stats.c index 31583b5491..8eb192c7d8 100644 --- a/ui/proto_hier_stats.c +++ b/ui/proto_hier_stats.c @@ -261,7 +261,7 @@ ph_stats_new(capture_file *cf) progbar_val = (gfloat) count / cf->count; if (progbar != NULL) { - g_snprintf(status_str, sizeof(status_str), + snprintf(status_str, sizeof(status_str), "%4u of %u frames", count, cf->count); update_progress_dlg(progbar, progbar_val, status_str); } diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index 1a8de81757..ad9f69584b 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -765,7 +765,7 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser memset(cur, ' ', 4); cur += 4; } - cur += g_snprintf(cur, 20, "%08X ", *global_pos); + cur += snprintf(cur, 20, "%08X ", *global_pos); /* 49 is space consumed by hex chars */ ascii_start = cur + 49 + 2; for (i = 0; i < 16 && current_pos + i < nchars; i++) { @@ -801,7 +801,7 @@ FollowStreamDialog::showBuffer(char *buffer, size_t nchars, gboolean is_from_ser case SHOW_CARRAY: current_pos = 0; - g_snprintf(initbuf, sizeof(initbuf), "char peer%d_%d[] = { /* Packet %u */\n", + snprintf(initbuf, sizeof(initbuf), "char peer%d_%d[] = { /* Packet %u */\n", is_from_server ? 1 : 0, is_from_server ? server_buffer_count_++ : client_buffer_count_++, packet_num); diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index f145f839a6..a1e5b404f8 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -741,7 +741,7 @@ int main(int argc, char *qt_argv[]) } #ifdef DEBUG_STARTUP_TIME - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "set_console_log_handler, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "set_console_log_handler, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif #ifdef HAVE_LIBPCAP @@ -761,7 +761,7 @@ int main(int argc, char *qt_argv[]) splash_update(RA_DISSECTORS, NULL, NULL); #ifdef DEBUG_STARTUP_TIME - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling epan init, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling epan init, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif /* Register all dissectors; we must do this before checking for the "-G" flag, as the "-G" flag dumps information registered by the @@ -775,7 +775,7 @@ int main(int argc, char *qt_argv[]) #ifdef DEBUG_STARTUP_TIME /* epan_init resets the preferences */ prefs.gui_console_open = console_open_always; - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "epan done, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "epan done, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif /* Register all audio codecs. */ @@ -794,7 +794,7 @@ int main(int argc, char *qt_argv[]) splash_update(RA_LISTENERS, NULL, NULL); #ifdef DEBUG_STARTUP_TIME - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Register all tap listeners, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Register all tap listeners, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif /* Register all tap listeners; we do this before we parse the arguments, as the "-z" argument can specify a registered tap. */ @@ -812,13 +812,13 @@ int main(int argc, char *qt_argv[]) } #ifdef DEBUG_STARTUP_TIME - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling extcap_register_preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif splash_update(RA_EXTCAP, NULL, NULL); extcap_register_preferences(); splash_update(RA_PREFERENCES, NULL, NULL); #ifdef DEBUG_STARTUP_TIME - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling module preferences, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif global_commandline_info.prefs_p = ws_app.readConfigurationFiles(false); @@ -840,7 +840,7 @@ int main(int argc, char *qt_argv[]) #ifdef HAVE_LIBPCAP #ifdef DEBUG_STARTUP_TIME - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling fill_in_local_interfaces, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif splash_update(RA_INTERFACES, NULL, NULL); @@ -917,7 +917,7 @@ int main(int argc, char *qt_argv[]) changed either from one of the preferences file or from the command line that their preferences have changed. */ #ifdef DEBUG_STARTUP_TIME - ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling prefs_apply_all, elapsed time %" G_GUINT64_FORMAT " us \n", g_get_monotonic_time() - start_time); + ws_log(LOG_DOMAIN_MAIN, LOG_LEVEL_INFO, "Calling prefs_apply_all, elapsed time %" PRIu64 " us \n", g_get_monotonic_time() - start_time); #endif prefs_apply_all(); prefs_to_capture_opts(); diff --git a/ui/qt/models/export_objects_model.cpp b/ui/qt/models/export_objects_model.cpp index 5a5ba64c37..ed42725b59 100644 --- a/ui/qt/models/export_objects_model.cpp +++ b/ui/qt/models/export_objects_model.cpp @@ -182,7 +182,7 @@ void ExportObjectModel::saveAllEntries(QString path) char generic_name[EXPORT_OBJECT_MAXFILELEN+1]; const char *ext; ext = eo_ct2ext(entry->content_type); - g_snprintf(generic_name, sizeof(generic_name), + snprintf(generic_name, sizeof(generic_name), "object%u%s%s", entry->pkt_num, ext ? "." : "", ext ? ext : ""); safe_filename = eo_massage_str(generic_name, diff --git a/ui/qt/sctp_chunk_statistics_dialog.cpp b/ui/qt/sctp_chunk_statistics_dialog.cpp index ea4de028f0..e2e5003e84 100644 --- a/ui/qt/sctp_chunk_statistics_dialog.cpp +++ b/ui/qt/sctp_chunk_statistics_dialog.cpp @@ -67,7 +67,7 @@ void SCTPChunkStatisticsDialog::initializeChunkMap() for (int i = 0; i < 256; i++) { temp.id = i; temp.row = i; - g_snprintf(buf, sizeof buf, "%d", i); + snprintf(buf, sizeof buf, "%d", i); (void) g_strlcpy(temp.name, val_to_str_const(i, chunk_type_values, "NA"), sizeof temp.name); if (strcmp(temp.name, "NA") == 0) { temp.hide = 1; @@ -248,7 +248,7 @@ void SCTPChunkStatisticsDialog::on_pushButton_clicked() for (int i = 0; i < chunks.size(); i++) { tempChunk = chunks.value(i); - g_snprintf(str, sizeof str, "\"%d\",\"%s\",\"%s\"\n", tempChunk.id, tempChunk.name, tempChunk.hide==0?"Show":"Hide"); + snprintf(str, sizeof str, "\"%d\",\"%s\",\"%s\"\n", tempChunk.id, tempChunk.name, tempChunk.hide==0?"Show":"Hide"); fputs(str, fp); void *rec = g_malloc0(uat->record_size); uat_add_record(uat, rec, TRUE); diff --git a/ui/qt/show_packet_bytes_dialog.cpp b/ui/qt/show_packet_bytes_dialog.cpp index 250c575858..8285802677 100644 --- a/ui/qt/show_packet_bytes_dialog.cpp +++ b/ui/qt/show_packet_bytes_dialog.cpp @@ -684,7 +684,7 @@ void ShowPacketBytesDialog::updatePacketBytes(void) int i; // Dump offset - cur += g_snprintf(cur, 20, "%0*X ", offset_chars, pos); + cur += snprintf(cur, 20, "%0*X ", offset_chars, pos); // Dump bytes as hex for (i = 0; i < 16 && pos + i < len; i++) { diff --git a/ui/summary.c b/ui/summary.c index fe0174ba9c..fedaefea86 100644 --- a/ui/summary.c +++ b/ui/summary.c @@ -99,7 +99,7 @@ hash_to_str(const unsigned char *hash, size_t length, char *str) { int i; for (i = 0; i < (int) length; i++) { - g_snprintf(str+(i*2), 3, "%02x", hash[i]); + snprintf(str+(i*2), 3, "%02x", hash[i]); } } diff --git a/ui/traffic_table_ui.c b/ui/traffic_table_ui.c index 6a003b07fb..10a76d87af 100644 --- a/ui/traffic_table_ui.c +++ b/ui/traffic_table_ui.c @@ -194,9 +194,9 @@ write_endpoint_geoip_map(FILE *fp, gboolean json_only, hostlist_talker_t *const json_dumper_value_anyf(&dumper, "%u", result->accuracy); } json_dumper_set_member_name(&dumper, "packets"); - json_dumper_value_anyf(&dumper, "%" G_GUINT64_FORMAT, host->rx_frames + host->tx_frames); + json_dumper_value_anyf(&dumper, "%" PRIu64, host->rx_frames + host->tx_frames); json_dumper_set_member_name(&dumper, "bytes"); - json_dumper_value_anyf(&dumper, "%" G_GUINT64_FORMAT, host->rx_bytes + host->tx_bytes); + json_dumper_value_anyf(&dumper, "%" PRIu64, host->rx_bytes + host->tx_bytes); } json_dumper_end_object(&dumper); // end properties |