From 22ee2764a7753c29133abebe83ba3c659f457b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Fri, 17 Dec 2021 20:05:19 +0000 Subject: [PATCH] Replace g_snprintf() with snprintf() (dissectors) Use macros from inttypes.h with format strings. --- .../packet-ieee1609dot2-template.c | 2 +- epan/dissectors/dcerpc/idl2wrs.c | 148 +++++----- epan/dissectors/file-file.c | 2 +- epan/dissectors/file-mp4.c | 8 +- epan/dissectors/file-pcapng.c | 18 +- epan/dissectors/packet-5co-legacy.c | 16 +- epan/dissectors/packet-9p.c | 2 +- epan/dissectors/packet-aarp.c | 2 +- epan/dissectors/packet-acdr.c | 2 +- epan/dissectors/packet-acn.c | 4 +- epan/dissectors/packet-acr122.c | 10 +- epan/dissectors/packet-aeron.c | 44 +-- epan/dissectors/packet-afp.c | 14 +- epan/dissectors/packet-agentx.c | 6 +- epan/dissectors/packet-aim.c | 2 +- epan/dissectors/packet-alljoyn.c | 2 +- epan/dissectors/packet-amqp.c | 16 +- epan/dissectors/packet-ansi_637.c | 8 +- epan/dissectors/packet-aprs.c | 8 +- epan/dissectors/packet-aruba-erm.c | 2 +- epan/dissectors/packet-asphodel.c | 2 +- epan/dissectors/packet-atm.c | 2 +- epan/dissectors/packet-autosar-nm.c | 2 +- epan/dissectors/packet-ax25-kiss.c | 4 +- epan/dissectors/packet-ax25-nol3.c | 6 +- epan/dissectors/packet-babel.c | 2 +- epan/dissectors/packet-bacapp.c | 10 +- epan/dissectors/packet-banana.c | 8 +- epan/dissectors/packet-ber.c | 14 +- epan/dissectors/packet-bgp.c | 4 +- epan/dissectors/packet-blip.c | 4 +- epan/dissectors/packet-bluetooth.c | 4 +- epan/dissectors/packet-bpsec.c | 4 +- epan/dissectors/packet-bpv7.c | 32 +- epan/dissectors/packet-bssgp.c | 14 +- epan/dissectors/packet-btatt.c | 20 +- epan/dissectors/packet-btavrcp.c | 8 +- epan/dissectors/packet-bthci_acl.c | 4 +- epan/dissectors/packet-bthci_cmd.c | 10 +- epan/dissectors/packet-bthci_evt.c | 2 +- epan/dissectors/packet-bthci_iso.c | 4 +- epan/dissectors/packet-bthci_sco.c | 4 +- epan/dissectors/packet-btl2cap.c | 8 +- epan/dissectors/packet-btle.c | 14 +- epan/dissectors/packet-btmesh.c | 276 +++++++++--------- epan/dissectors/packet-btrfcomm.c | 4 +- epan/dissectors/packet-btsdp.c | 2 +- epan/dissectors/packet-bvlc.c | 4 +- epan/dissectors/packet-c15ch.c | 32 +- epan/dissectors/packet-catapult-dct2000.c | 6 +- epan/dissectors/packet-cbor.c | 8 +- epan/dissectors/packet-cemi.c | 30 +- epan/dissectors/packet-ceph.c | 88 +++--- epan/dissectors/packet-cip.c | 2 +- epan/dissectors/packet-coap.c | 6 +- epan/dissectors/packet-collectd.c | 12 +- epan/dissectors/packet-communityid.c | 6 +- epan/dissectors/packet-cops.c | 6 +- epan/dissectors/packet-corosync-totemsrp.c | 14 +- epan/dissectors/packet-cose.c | 4 +- epan/dissectors/packet-cpfi.c | 4 +- epan/dissectors/packet-dccp.c | 28 +- epan/dissectors/packet-dcerpc-epm.c | 2 +- epan/dissectors/packet-dcerpc-ndr.c | 32 +- epan/dissectors/packet-dcerpc.c | 2 +- epan/dissectors/packet-dcom.c | 6 +- epan/dissectors/packet-dhcpv6.c | 4 +- epan/dissectors/packet-dlep.c | 10 +- epan/dissectors/packet-dlsw.c | 2 +- epan/dissectors/packet-dlt.c | 4 +- epan/dissectors/packet-dmp.c | 10 +- epan/dissectors/packet-dns.c | 10 +- epan/dissectors/packet-docsis-macmgmt.c | 12 +- epan/dissectors/packet-docsis-tlv.c | 4 +- epan/dissectors/packet-drbd.c | 8 +- epan/dissectors/packet-dtls.c | 8 +- epan/dissectors/packet-dvbci.c | 4 +- epan/dissectors/packet-ecmp.c | 12 +- epan/dissectors/packet-edonkey.c | 4 +- epan/dissectors/packet-eigrp.c | 6 +- epan/dissectors/packet-elasticsearch.c | 6 +- epan/dissectors/packet-enip.c | 4 +- epan/dissectors/packet-epl-profile-parser.c | 2 +- epan/dissectors/packet-epl.c | 10 +- epan/dissectors/packet-erf.c | 10 +- epan/dissectors/packet-erldp.c | 12 +- epan/dissectors/packet-etag.c | 2 +- epan/dissectors/packet-ethertype.c | 2 +- epan/dissectors/packet-f5ethtrailer.c | 10 +- epan/dissectors/packet-fcswils.c | 8 +- epan/dissectors/packet-fddi.c | 14 +- epan/dissectors/packet-flip.c | 2 +- epan/dissectors/packet-frame.c | 2 +- epan/dissectors/packet-ftdi-mpsse.c | 4 +- epan/dissectors/packet-geonw.c | 22 +- epan/dissectors/packet-gfp.c | 2 +- epan/dissectors/packet-glusterfs.c | 4 +- epan/dissectors/packet-gmr1_bcch.c | 12 +- epan/dissectors/packet-gmr1_rach.c | 48 +-- epan/dissectors/packet-gmr1_rr.c | 22 +- epan/dissectors/packet-gquic.c | 12 +- epan/dissectors/packet-gsm_a_bssmap.c | 30 +- epan/dissectors/packet-gsm_a_common.c | 12 +- epan/dissectors/packet-gsm_a_dtap.c | 30 +- epan/dissectors/packet-gsm_a_gm.c | 8 +- epan/dissectors/packet-gsm_a_rp.c | 2 +- epan/dissectors/packet-gsm_a_rr.c | 4 +- epan/dissectors/packet-gsm_abis_oml.c | 10 +- epan/dissectors/packet-gtpv2.c | 8 +- epan/dissectors/packet-gvcp.c | 2 +- epan/dissectors/packet-gvsp.c | 2 +- epan/dissectors/packet-h264.c | 4 +- epan/dissectors/packet-h265.c | 4 +- epan/dissectors/packet-hdcp.c | 4 +- epan/dissectors/packet-hdmi.c | 2 +- epan/dissectors/packet-homeplug-av.c | 2 +- epan/dissectors/packet-homeplug.c | 2 +- epan/dissectors/packet-http.c | 2 +- epan/dissectors/packet-http2.c | 2 +- epan/dissectors/packet-http3.c | 14 +- epan/dissectors/packet-i2c.c | 2 +- epan/dissectors/packet-iax2.c | 2 +- epan/dissectors/packet-idn.c | 58 ++-- epan/dissectors/packet-ieee1609dot2.c | 2 +- epan/dissectors/packet-ieee17221.c | 2 +- epan/dissectors/packet-ieee1905.c | 12 +- epan/dissectors/packet-ieee80211-prism.c | 2 +- epan/dissectors/packet-ieee80211-radiotap.c | 4 +- epan/dissectors/packet-ieee80211.c | 174 +++++------ epan/dissectors/packet-ieee802154.c | 8 +- epan/dissectors/packet-igmp.c | 2 +- epan/dissectors/packet-infiniband.c | 2 +- epan/dissectors/packet-ip.c | 10 +- epan/dissectors/packet-ipars.c | 10 +- epan/dissectors/packet-ipmi-picmg.c | 8 +- epan/dissectors/packet-ipmi-transport.c | 6 +- epan/dissectors/packet-ipmi.c | 26 +- epan/dissectors/packet-ipp.c | 2 +- epan/dissectors/packet-ipsec.c | 16 +- epan/dissectors/packet-ipv6.c | 2 +- epan/dissectors/packet-isakmp.c | 18 +- epan/dissectors/packet-isobus-vt.c | 6 +- epan/dissectors/packet-isobus.c | 6 +- epan/dissectors/packet-j1939.c | 4 +- epan/dissectors/packet-kafka.c | 20 +- epan/dissectors/packet-kdp.c | 6 +- epan/dissectors/packet-kink.c | 2 +- epan/dissectors/packet-knxip.c | 66 ++--- epan/dissectors/packet-knxip_decrypt.c | 6 +- epan/dissectors/packet-l2tp.c | 2 +- epan/dissectors/packet-lapsat.c | 6 +- epan/dissectors/packet-lbmc.c | 20 +- epan/dissectors/packet-lbmpdm.c | 4 +- epan/dissectors/packet-lbmr.c | 36 +-- epan/dissectors/packet-lbmsrs.c | 2 +- epan/dissectors/packet-lbtrm.c | 26 +- epan/dissectors/packet-lbtru.c | 18 +- epan/dissectors/packet-lbttcp.c | 4 +- epan/dissectors/packet-lisp-tcp.c | 2 +- epan/dissectors/packet-llc.c | 2 +- epan/dissectors/packet-lldp.c | 6 +- epan/dissectors/packet-loratap.c | 6 +- epan/dissectors/packet-ltp.c | 12 +- epan/dissectors/packet-lustre.c | 10 +- epan/dissectors/packet-lwm2mtlv.c | 4 +- epan/dissectors/packet-mac-lte.c | 4 +- epan/dissectors/packet-mac-nr.c | 18 +- epan/dissectors/packet-manolito.c | 2 +- epan/dissectors/packet-mbim.c | 82 +++--- epan/dissectors/packet-megaco.c | 2 +- epan/dissectors/packet-metamako.c | 2 +- epan/dissectors/packet-mgcp.c | 2 +- epan/dissectors/packet-mip6.c | 2 +- epan/dissectors/packet-mka.c | 2 +- epan/dissectors/packet-moldudp.c | 2 +- epan/dissectors/packet-moldudp64.c | 2 +- epan/dissectors/packet-mpeg-sect.c | 2 +- epan/dissectors/packet-mpls.c | 4 +- epan/dissectors/packet-mq-pcf.c | 12 +- epan/dissectors/packet-mq.c | 2 +- epan/dissectors/packet-msgpack.c | 4 +- epan/dissectors/packet-msnlb.c | 2 +- epan/dissectors/packet-mswsp.c | 18 +- epan/dissectors/packet-mtp2.c | 2 +- epan/dissectors/packet-mtp3.c | 42 +-- epan/dissectors/packet-mysql.c | 2 +- epan/dissectors/packet-nas_5gs.c | 6 +- epan/dissectors/packet-nas_eps.c | 4 +- epan/dissectors/packet-nbd.c | 4 +- epan/dissectors/packet-nbt.c | 8 +- epan/dissectors/packet-ncp2222.inc | 10 +- epan/dissectors/packet-netanalyzer.c | 2 +- epan/dissectors/packet-netflow.c | 2 +- epan/dissectors/packet-netlink-net_dm.c | 2 +- epan/dissectors/packet-netlink-psample.c | 4 +- epan/dissectors/packet-netlink-route.c | 8 +- epan/dissectors/packet-netmon.c | 8 +- epan/dissectors/packet-nfapi.c | 24 +- epan/dissectors/packet-nfs.c | 66 ++--- epan/dissectors/packet-nlm.c | 2 +- epan/dissectors/packet-noe.c | 10 +- epan/dissectors/packet-ntlmssp.c | 2 +- epan/dissectors/packet-ntp.c | 8 +- epan/dissectors/packet-nvme-rdma.c | 4 +- epan/dissectors/packet-nvme.c | 74 ++--- epan/dissectors/packet-obex.c | 8 +- epan/dissectors/packet-ocfs2.c | 4 +- epan/dissectors/packet-opa-mad.c | 70 ++--- epan/dissectors/packet-opa-snc.c | 4 +- epan/dissectors/packet-opa.c | 2 +- epan/dissectors/packet-optommp.c | 4 +- epan/dissectors/packet-oran.c | 10 +- epan/dissectors/packet-ositp.c | 8 +- epan/dissectors/packet-osmo_trx.c | 4 +- epan/dissectors/packet-ouch.c | 16 +- epan/dissectors/packet-p_mul.c | 2 +- epan/dissectors/packet-pcli.c | 2 +- epan/dissectors/packet-pdcp-lte.c | 4 +- epan/dissectors/packet-pdcp-nr.c | 4 +- epan/dissectors/packet-pdu-transport.c | 2 +- epan/dissectors/packet-per.c | 12 +- epan/dissectors/packet-pgm.c | 18 +- epan/dissectors/packet-protobuf.c | 22 +- epan/dissectors/packet-ptp.c | 2 +- epan/dissectors/packet-ptpip.c | 2 +- epan/dissectors/packet-pvfs2.c | 4 +- epan/dissectors/packet-pw-common.c | 2 +- epan/dissectors/packet-pw-fr.c | 2 +- epan/dissectors/packet-qnet6.c | 12 +- epan/dissectors/packet-quic.c | 40 +-- epan/dissectors/packet-radius.c | 8 +- epan/dissectors/packet-raknet.c | 22 +- epan/dissectors/packet-reload.c | 2 +- epan/dissectors/packet-rfid-pn532.c | 8 +- epan/dissectors/packet-rlc-lte.c | 6 +- epan/dissectors/packet-rlc-nr.c | 6 +- epan/dissectors/packet-rmt-lct.c | 4 +- epan/dissectors/packet-rpc.c | 2 +- epan/dissectors/packet-rsl.c | 4 +- epan/dissectors/packet-rtacser.c | 2 +- epan/dissectors/packet-rtcp.c | 4 +- epan/dissectors/packet-rtls.c | 2 +- epan/dissectors/packet-rtmpt.c | 4 +- epan/dissectors/packet-rtnet.c | 4 +- epan/dissectors/packet-rtp.c | 4 +- .../packet-rtps-virtual-transport.c | 20 +- epan/dissectors/packet-rtps.c | 80 ++--- epan/dissectors/packet-rtsp.c | 2 +- epan/dissectors/packet-s5066dts.c | 2 +- epan/dissectors/packet-s7comm.c | 6 +- epan/dissectors/packet-sccp.c | 2 +- epan/dissectors/packet-scsi-sbc.c | 26 +- epan/dissectors/packet-sctp.c | 22 +- epan/dissectors/packet-scylla.c | 4 +- epan/dissectors/packet-sdp.c | 2 +- epan/dissectors/packet-selfm.c | 2 +- epan/dissectors/packet-sercosiii.c | 2 +- epan/dissectors/packet-sgsap.c | 14 +- epan/dissectors/packet-signal-pdu.c | 12 +- epan/dissectors/packet-sip.c | 2 +- epan/dissectors/packet-sll.c | 2 +- epan/dissectors/packet-smb-sidsnooping.c | 2 +- epan/dissectors/packet-smb.c | 20 +- epan/dissectors/packet-smb2.c | 16 +- epan/dissectors/packet-sml.c | 2 +- epan/dissectors/packet-smp.c | 2 +- epan/dissectors/packet-smpp.c | 2 +- epan/dissectors/packet-snort-config.c | 2 +- epan/dissectors/packet-snort.c | 2 +- epan/dissectors/packet-socketcan.c | 4 +- epan/dissectors/packet-someip-sd.c | 22 +- epan/dissectors/packet-someip.c | 4 +- epan/dissectors/packet-stanag4607.c | 36 +-- epan/dissectors/packet-steam-ihs-discovery.c | 20 +- epan/dissectors/packet-stt.c | 2 +- epan/dissectors/packet-synphasor.c | 8 +- epan/dissectors/packet-sysdig-event.c | 2 +- epan/dissectors/packet-t30.c | 12 +- epan/dissectors/packet-tcp.c | 26 +- epan/dissectors/packet-tcpcl.c | 16 +- epan/dissectors/packet-tds.c | 12 +- epan/dissectors/packet-thrift.c | 6 +- epan/dissectors/packet-tibia.c | 2 +- epan/dissectors/packet-tipc.c | 2 +- epan/dissectors/packet-tls-utils.c | 40 +-- epan/dissectors/packet-tls.c | 10 +- epan/dissectors/packet-tns.c | 2 +- epan/dissectors/packet-tpncp.c | 4 +- epan/dissectors/packet-u3v.c | 8 +- epan/dissectors/packet-ua3g.c | 4 +- epan/dissectors/packet-uavcan-can.c | 4 +- epan/dissectors/packet-udp.c | 6 +- epan/dissectors/packet-uds.c | 4 +- epan/dissectors/packet-umts_rlc.c | 6 +- epan/dissectors/packet-usb.c | 8 +- epan/dissectors/packet-usbll.c | 4 +- epan/dissectors/packet-vsip.c | 2 +- epan/dissectors/packet-vsock.c | 2 +- epan/dissectors/packet-wai.c | 2 +- epan/dissectors/packet-wassp.c | 30 +- epan/dissectors/packet-windows-common.c | 4 +- epan/dissectors/packet-wireguard.c | 2 +- epan/dissectors/packet-wtls.c | 8 +- epan/dissectors/packet-wtp.c | 8 +- epan/dissectors/packet-x11.c | 2 +- epan/dissectors/packet-xtp.c | 26 +- epan/dissectors/packet-yami.c | 4 +- epan/dissectors/packet-zbee-nwk.c | 2 +- epan/dissectors/packet-zbee-zcl-general.c | 46 +-- epan/dissectors/packet-zbee-zcl-ha.c | 6 +- epan/dissectors/packet-zbee-zcl-lighting.c | 8 +- .../dissectors/packet-zbee-zcl-meas-sensing.c | 92 +++--- epan/dissectors/packet-zbee-zcl-se.c | 20 +- epan/dissectors/packet-zbee-zcl.c | 36 +-- epan/dissectors/packet-zbee-zdp.c | 10 +- wiretap/pcapng.c | 2 +- 316 files changed, 1906 insertions(+), 1900 deletions(-) diff --git a/epan/dissectors/asn1/ieee1609dot2/packet-ieee1609dot2-template.c b/epan/dissectors/asn1/ieee1609dot2/packet-ieee1609dot2-template.c index 718c261496..7708899769 100644 --- a/epan/dissectors/asn1/ieee1609dot2/packet-ieee1609dot2-template.c +++ b/epan/dissectors/asn1/ieee1609dot2/packet-ieee1609dot2-template.c @@ -116,7 +116,7 @@ ieee1609dot2_Time64_fmt(gchar *s, guint64 v) time_t secs = v / 1000000 + 1072915200 - 5; guint32 usecs = v % 1000000; struct tm *tm = gmtime(&secs); - snprintf(s, ITEM_LABEL_LENGTH, "%u-%02u-%02u %02u:%02u:%02u.%06u (%" G_GUINT64_FORMAT ")", + snprintf(s, ITEM_LABEL_LENGTH, "%u-%02u-%02u %02u:%02u:%02u.%06u (%" PRIu64 ")", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, usecs, v ); } diff --git a/epan/dissectors/dcerpc/idl2wrs.c b/epan/dissectors/dcerpc/idl2wrs.c index a0e3d4658e..67bc9ed3ce 100644 --- a/epan/dissectors/dcerpc/idl2wrs.c +++ b/epan/dissectors/dcerpc/idl2wrs.c @@ -885,13 +885,13 @@ static void parseheader(void) FPRINTF(NULL,"Interface:%s\n",ifname); /* opnum */ - g_snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_opnum", ifname); - g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.opnum", ifname); + snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_opnum", ifname); + snprintf(filter_name, BASE_BUFFER_SIZE, "%s.opnum", ifname); register_hf_field(hf_status, "Operation", filter_name, "FT_UINT16", "BASE_DEC", "NULL", "0", ""); /* status */ - g_snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_rc", ifname); - g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.rc", ifname); + snprintf(hf_status, BASE_BUFFER_SIZE, "hf_%s_rc", ifname); + snprintf(filter_name, BASE_BUFFER_SIZE, "%s.rc", ifname); register_hf_field(hf_status, "Return code", filter_name, "FT_UINT32", "BASE_HEX", "VALS(NT_errors)", "0", ""); FPRINTF(eth_ett, "static gint ett_%s = -1;\n", ifname); @@ -1090,7 +1090,7 @@ find_type(char *name) if(!tmptype){ char dissectorname[DISSECTORNAME_MAXLEN]; if(!g_strcmp0(name,"uint16")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1102,7 +1102,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type("uint16", dissectorname, "FT_UINT16", "BASE_DEC", "0", "NULL", 2); } else if(!g_strcmp0(name,"int16")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1114,7 +1114,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type("int16", dissectorname, "FT_INT16", "BASE_DEC", "0", "NULL", 2); } else if(!g_strcmp0(name,"uint32")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1127,7 +1127,7 @@ find_type(char *name) tmptype=register_new_type("uint32", dissectorname, "FT_UINT32", "BASE_DEC", "0", "NULL", 4); } else if( (!g_strcmp0(name,"int32")) || (!g_strcmp0(name,"long")) ){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1142,7 +1142,7 @@ find_type(char *name) else tmptype=register_new_type("long", dissectorname, "FT_INT32", "BASE_DEC", "0", "NULL", 4); } else if( (!g_strcmp0(name,"uint8")) ){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1155,7 +1155,7 @@ find_type(char *name) tmptype=register_new_type("uint8", dissectorname, "FT_UINT8", "BASE_DEC", "0", "NULL", 1); } else if( (!g_strcmp0(name,"int8")) || (!g_strcmp0(name, "char")) ){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1170,7 +1170,7 @@ find_type(char *name) else tmptype=register_new_type("char", dissectorname, "FT_INT8", "BASE_DEC", "0", "NULL", 1); } else if(!g_strcmp0(name,"bool8")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1182,7 +1182,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type("bool8", dissectorname, "FT_INT8", "BASE_DEC", "0", "NULL", 1); } else if(!g_strcmp0(name,"unistr")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1194,7 +1194,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type("unistr", dissectorname, "FT_STRING", "BASE_NONE", "0", "NULL", 4); } else if(!g_strcmp0(name,"ascstr")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1207,7 +1207,7 @@ find_type(char *name) tmptype=register_new_type("ascstr", dissectorname, "FT_STRING", "BASE_NONE", "0", "NULL", 4); } else if(!g_strcmp0(name,"GUID") ||!g_strcmp0(name,"uuid_t")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1219,7 +1219,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type(name, dissectorname, "FT_GUID", "BASE_NONE", "0", "NULL", 4); } else if(!g_strcmp0(name,"policy_handle")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static e_ctx_hnd policy_hnd;\n"); @@ -1238,7 +1238,7 @@ find_type(char *name) tmptype=register_new_type("policy_handle", dissectorname, "FT_BYTES", "BASE_NONE", "0", "NULL", 4); } else if(!g_strcmp0(name,"NTTIME")){ /* 8 bytes, aligned to 4 bytes */ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1253,7 +1253,7 @@ find_type(char *name) tmptype=register_new_type("NTTIME", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4); } else if(!g_strcmp0(name,"NTTIME_hyper")){ /* 8 bytes, aligned to 8 bytes */ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1269,7 +1269,7 @@ find_type(char *name) tmptype=register_new_type("NTTIME_hyper", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4); } else if(!g_strcmp0(name,"NTTIME_1sec")){ /* 8 bytes, aligned to 8 bytes */ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1285,7 +1285,7 @@ find_type(char *name) tmptype=register_new_type("NTTIME_1sec", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4); } else if(!g_strcmp0(name,"udlong")){ /* 8 bytes, aligned to 4 bytes */ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1300,7 +1300,7 @@ find_type(char *name) tmptype=register_new_type("udlong", dissectorname, "FT_UINT64", "BASE_DEC", "0", "NULL", 4); } else if(!g_strcmp0(name,"dlong")){ /* 8 bytes, aligned to 4 bytes */ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1315,7 +1315,7 @@ find_type(char *name) tmptype=register_new_type("dlong", dissectorname, "FT_INT64", "BASE_DEC", "0", "NULL", 4); } else if(!g_strcmp0(name,"uint64")){ /* 8 bytes, aligned to 8 bytes */ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1330,7 +1330,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type("uint64", dissectorname, "FT_UINT64", "BASE_DEC", "0", "NULL", 8); } else if(!g_strcmp0(name,"time_t")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1344,7 +1344,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type("time_t", dissectorname, "FT_ABSOLUTE_TIME", "ABSOLUTE_TIME_LOCAL", "0", "NULL", 4); } else if(!g_strcmp0(name,"SID")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1358,7 +1358,7 @@ find_type(char *name) FPRINTF(eth_code, "\n"); tmptype=register_new_type("SID", dissectorname, "FT_STRING", "BASE_NONE", "0", "NULL", 4); } else if(!g_strcmp0(name,"WERROR")){ - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, name); FPRINTF(NULL,"\nAutogenerating built-in type:%s\n------------\n",name); FPRINTF(eth_code, "\n"); FPRINTF(eth_code, "static int\n"); @@ -1537,7 +1537,7 @@ static void parsetypedefstruct(int pass) } struct_name=tmpti->next->str; - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, struct_name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, struct_name); FPRINTF(NULL,"\nSTRUCT:%s pass:%d\n-------\n",struct_name,pass); @@ -1668,7 +1668,7 @@ static void parsetypedefstruct(int pass) FPRINTF(stderr, "ERROR: invalid integer: %s\n", ti->str); Exit(10); } - g_snprintf(fss, BASE_BUFFER_SIZE, "%d", fixed_array_size); + snprintf(fss, BASE_BUFFER_SIZE, "%d", fixed_array_size); if(!g_strcmp0("]", ti->str)){ /* this is just a normal [] array */ @@ -1693,17 +1693,17 @@ static void parsetypedefstruct(int pass) ti=ti->next; } - g_snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, struct_name, field_name); + snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, struct_name, field_name); /* pass 0 generate subdissectors */ if(pass==0){ char filter_name[BASE_BUFFER_SIZE]; const char *hf; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name); ptmpstr=g_strdup(tmpstr); if(check_if_to_emit(tmpstr)){ - g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, struct_name, field_name); + snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, struct_name, field_name); hf=register_hf_field(hf_index, field_name, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, ""); FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", ptmpstr); @@ -1720,7 +1720,7 @@ static void parsetypedefstruct(int pass) if(is_array_of_pointers){ pointer_type=pi->type; pi=pi->next; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); if(check_if_to_emit(tmpstr)){ FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); @@ -1735,7 +1735,7 @@ static void parsetypedefstruct(int pass) ptmpstr=g_strdup(tmpstr); } else if(fixed_array_size){ - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr); if(check_if_to_emit(tmpstr)){ FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); @@ -1760,7 +1760,7 @@ static void parsetypedefstruct(int pass) case 0: break; case BI_SIZE_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); if(check_if_to_emit(tmpstr)){ FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); @@ -1775,7 +1775,7 @@ static void parsetypedefstruct(int pass) ptmpstr=g_strdup(tmpstr); break; case BI_LENGTH_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr); if(check_if_to_emit(tmpstr)){ FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); @@ -1790,7 +1790,7 @@ static void parsetypedefstruct(int pass) ptmpstr=g_strdup(tmpstr); break; case BI_SIZE_IS|BI_LENGTH_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); if(check_if_to_emit(tmpstr)){ FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); @@ -1814,7 +1814,7 @@ static void parsetypedefstruct(int pass) while(num_pointers--){ pointer_type=pi->type; pi=pi->next; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); if(check_if_to_emit(tmpstr)){ FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); @@ -1832,17 +1832,17 @@ static void parsetypedefstruct(int pass) } if(pass==1){ - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, struct_name, field_name); ptmpstr=g_strdup(tmpstr); /* handle fixedsizearrays */ if(is_array_of_pointers){ pointer_type=pi->type; pi=pi->next; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); ptmpstr=g_strdup(tmpstr); } else if(fixed_array_size){ - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "fixedarray_%s", ptmpstr); ptmpstr=g_strdup(tmpstr); } @@ -1852,15 +1852,15 @@ static void parsetypedefstruct(int pass) case 0: break; case BI_SIZE_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); ptmpstr=g_strdup(tmpstr); break; case BI_LENGTH_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "uvarray_%s", ptmpstr); ptmpstr=g_strdup(tmpstr); break; case BI_SIZE_IS|BI_LENGTH_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); ptmpstr=g_strdup(tmpstr); break; default: @@ -1873,7 +1873,7 @@ static void parsetypedefstruct(int pass) while(num_pointers--){ pointer_type=pi->type; pi=pi->next; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); ptmpstr=g_strdup(tmpstr); } @@ -1999,7 +1999,7 @@ static void parsetypedefbitmap(int pass) Exit(10); } bitmap_name=tmpti->next->str; - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, bitmap_name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, bitmap_name); FPRINTF(NULL,"\nBITMAP:%s pass:%d\n-------\n",bitmap_name,pass); @@ -2062,7 +2062,7 @@ static void parsetypedefbitmap(int pass) name=ti->str; ti=ti->next; - g_snprintf(hf_bitname, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, bitmap_name, name); + snprintf(hf_bitname, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, bitmap_name, name); if(g_strcmp0(ti->str, "=")){ FPRINTF(stderr, "ERROR: typedefbitmap i expected a '=' here\n"); @@ -2088,9 +2088,9 @@ static void parsetypedefbitmap(int pass) if(pass==0){ char filter_name[BASE_BUFFER_SIZE], base_name[BASE_BUFFER_SIZE], tfs_name[BASE_BUFFER_SIZE]; - g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, bitmap_name, name); - g_snprintf(base_name, BASE_BUFFER_SIZE, "%d", alignment*8); - g_snprintf(tfs_name, BASE_BUFFER_SIZE, "TFS(&%s_tfs)", name); + snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, bitmap_name, name); + snprintf(base_name, BASE_BUFFER_SIZE, "%d", alignment*8); + snprintf(tfs_name, BASE_BUFFER_SIZE, "TFS(&%s_tfs)", name); register_hf_field(hf_bitname, name, filter_name, "FT_BOOLEAN", base_name, tfs_name, value, ""); FPRINTF(eth_code, "static const true_false_string %s_tfs = {\n",name); @@ -2247,7 +2247,7 @@ static void parsetypedefunion(int pass) Exit(10); } union_name=tmpti->next->str; - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_union_%s", ifname, union_name); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_union_%s", ifname, union_name); FPRINTF(NULL,"\nUNION:%s pass:%d\n-------\n",union_name,pass); @@ -2401,16 +2401,16 @@ static void parsetypedefunion(int pass) alignment=item_alignment; } - g_snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str); + snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str); /* pass 0 generate subdissectors */ if(pass==0){ char filter_name[BASE_BUFFER_SIZE]; const char *hf; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str); ptmpstr=g_strdup(tmpstr); - g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, union_name, ti->str); + snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, union_name, ti->str); hf=register_hf_field(hf_index, ti->str, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, ""); FPRINTF(eth_code, "static int\n"); @@ -2424,7 +2424,7 @@ static void parsetypedefunion(int pass) /* handle pointers */ while(num_pointers--){ - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique"); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique"); FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); FPRINTF(eth_code, "{\n"); @@ -2440,10 +2440,10 @@ static void parsetypedefunion(int pass) if(pass==1){ /* handle pointers */ - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_union_%s_%s_%s", ifname, union_name, case2str(bi->case_name), ti->str); ptmpstr=g_strdup(tmpstr); while(num_pointers--){ - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique"); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", ptmpstr, "unique"); ptmpstr=g_strdup(tmpstr); } @@ -2642,16 +2642,16 @@ static void parsefunction(int pass) */ pi=prepend_pointer_list(bi->pointer_list, num_pointers); - g_snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, function_name, ti->str); + snprintf(hf_index, BASE_BUFFER_SIZE, "hf_%s_%s_%s", ifname, function_name, ti->str); /* pass 0 generate subdissectors */ if(pass==0){ char filter_name[BASE_BUFFER_SIZE]; const char *hf; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str); ptmpstr=g_strdup(tmpstr); - g_snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, function_name, ti->str); + snprintf(filter_name, BASE_BUFFER_SIZE, "%s.%s.%s", ifname, function_name, ti->str); hf=register_hf_field(hf_index, ti->str, filter_name, type_item->ft_type, type_item->base_type, type_item->vals, type_item->mask, ""); FPRINTF(eth_code, "static int\n"); @@ -2670,7 +2670,7 @@ static void parsefunction(int pass) case 0: break; case BI_SIZE_IS|BI_LENGTH_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); FPRINTF(eth_code, "{\n"); @@ -2681,7 +2681,7 @@ static void parsefunction(int pass) ptmpstr=g_strdup(tmpstr); break; case BI_SIZE_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); FPRINTF(eth_code, "{\n"); @@ -2701,7 +2701,7 @@ static void parsefunction(int pass) while(num_pointers--){ pointer_type=pi->type; pi=pi->next; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); FPRINTF(eth_code, "static int\n"); FPRINTF(eth_code, "%s(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep)\n", tmpstr); FPRINTF(eth_code, "{\n"); @@ -2716,7 +2716,7 @@ static void parsefunction(int pass) } if((pass==1)||(pass==2)){ - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_dissect_%s_%s", ifname, function_name, ti->str); ptmpstr=g_strdup(tmpstr); if(bi){ @@ -2724,11 +2724,11 @@ static void parsefunction(int pass) case 0: break; case BI_SIZE_IS|BI_LENGTH_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucvarray_%s", ptmpstr); ptmpstr=g_strdup(tmpstr); break; case BI_SIZE_IS: - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "ucarray_%s", ptmpstr); ptmpstr=g_strdup(tmpstr); break; default: @@ -2741,7 +2741,7 @@ static void parsefunction(int pass) while(num_pointers--){ pointer_type=pi->type; pi=pi->next; - g_snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); + snprintf(tmpstr, BASE_BUFFER_SIZE, "%s_%s", pointer_type, ptmpstr); ptmpstr=g_strdup(tmpstr); } @@ -2928,8 +2928,8 @@ static void parsetypedefenum(void) Exit(10); } - g_snprintf(valsstring, BASE_BUFFER_SIZE, "%s_%s_vals", ifname, ti->str); - g_snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, ti->str); + snprintf(valsstring, BASE_BUFFER_SIZE, "%s_%s_vals", ifname, ti->str); + snprintf(dissectorname, DISSECTORNAME_MAXLEN, "%s_dissect_%s", ifname, ti->str); FPRINTF(NULL,"\nENUM:%s\n-------\n",ti->str); @@ -2972,7 +2972,7 @@ static void parsetypedefenum(void) FPRINTF(eth_code, "\n"); - g_snprintf(hfvalsstring, BASE_BUFFER_SIZE, "VALS(%s)", valsstring); + snprintf(hfvalsstring, BASE_BUFFER_SIZE, "VALS(%s)", valsstring); switch(enumsize){ case 16: register_new_type(ti->str, dissectorname, "FT_INT16", "BASE_DEC", "0", hfvalsstring, 2); @@ -3248,14 +3248,14 @@ int main(int argc, char *argv[]) eth_ft=g_fopen("ETH_FT", "w"); eth_handoff=g_fopen("ETH_HANDOFF", "w"); - g_snprintf(idlfile, BASE_BUFFER_SIZE, "%s.cnf", argv[1]); + snprintf(idlfile, BASE_BUFFER_SIZE, "%s.cnf", argv[1]); fh=g_fopen(idlfile,"r"); if(fh){ readcnffile(fh); fclose(fh); } - g_snprintf(idlfile, BASE_BUFFER_SIZE, "%s.idl", argv[1]); + snprintf(idlfile, BASE_BUFFER_SIZE, "%s.idl", argv[1]); fh=g_fopen(idlfile,"r"); if(!fh){ FPRINTF(stderr, "ERROR: could not open idl-file:%s\n", idlfile); @@ -3278,7 +3278,7 @@ int main(int argc, char *argv[]) search through the tokenlist and g_remove all such prefixes */ - g_snprintf(prefix_str, BASE_BUFFER_SIZE, "%s_", ifname); + snprintf(prefix_str, BASE_BUFFER_SIZE, "%s_", ifname); preparetrimprefix(prefix_str); trimprefix(); @@ -3405,9 +3405,9 @@ int main(int argc, char *argv[]) check_hf_rename_refcount(); /* merge code and template into dissector */ - g_snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.c", ifname); + snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.c", ifname); fh=g_fopen(line, "w"); - g_snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.c", argv[1]); + snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.c", argv[1]); tfh=g_fopen(tmplfile, "r"); if(!tfh){ FPRINTF(stderr, "ERROR: could not find %s\n", tmplfile); @@ -3441,9 +3441,9 @@ int main(int argc, char *argv[]) fclose(fh); fclose(tfh); - g_snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.h", ifname); + snprintf(line, 4 * BASE_BUFFER_SIZE, "packet-dcerpc-%s.h", ifname); fh=g_fopen(line, "w"); - g_snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.h", argv[1]); + snprintf(tmplfile, BASE_BUFFER_SIZE, "packet-dcerpc-%s-template.h", argv[1]); tfh=g_fopen(tmplfile, "r"); if(!tfh){ FPRINTF(stderr, "ERROR: could not find %s\n", tmplfile); diff --git a/epan/dissectors/file-file.c b/epan/dissectors/file-file.c index c13101a2d8..774661b0a1 100644 --- a/epan/dissectors/file-file.c +++ b/epan/dissectors/file-file.c @@ -141,7 +141,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, if (show_file_off) { proto_tree_add_int64_format_value(fh_tree, hf_frame_file_off, tvb, 0, 0, pinfo->fd->file_off, - "%" G_GINT64_MODIFIER "d (0x%" G_GINT64_MODIFIER "x)", + "%" PRId64 " (0x%" PRIx64 ")", pinfo->fd->file_off, pinfo->fd->file_off); } #endif diff --git a/epan/dissectors/file-mp4.c b/epan/dissectors/file-mp4.c index 2725675d2c..4573680632 100644 --- a/epan/dissectors/file-mp4.c +++ b/epan/dissectors/file-mp4.c @@ -290,12 +290,12 @@ dissect_mp4_mvhd_body(tvbuff_t *tvb, gint offset, gint len _U_, if (mvhd_timescale == 0) { proto_tree_add_uint64_format(tree, hf_mp4_mvhd_duration, tvb, offset, time_len, duration, - "Duration: no timescale (%" G_GUINT64_FORMAT ")", + "Duration: no timescale (%" PRIu64 ")", duration); } else { proto_tree_add_uint64_format(tree, hf_mp4_mvhd_duration, tvb, offset, time_len, duration, - "Duration: %f seconds (%" G_GUINT64_FORMAT ")", + "Duration: %f seconds (%" PRIu64 ")", (double) duration / mvhd_timescale, duration); } offset += time_len; @@ -785,7 +785,7 @@ dissect_mp4_elst_body(tvbuff_t *tvb, gint offset, gint len, segment_duration_str = timescaled_val_to_str(pinfo->pool, segment_duration); proto_tree_add_uint64_format(subtree, hf_mp4_elst_segment_duration, tvb, offset, field_length, segment_duration, - "Segment duration: %s (%" G_GUINT64_FORMAT ")", + "Segment duration: %s (%" PRIu64 ")", segment_duration_str, segment_duration); offset += field_length; @@ -797,7 +797,7 @@ dissect_mp4_elst_body(tvbuff_t *tvb, gint offset, gint len, media_time_str = timescaled_val_to_str(pinfo->pool, media_time); proto_tree_add_int64_format(subtree, hf_mp4_elst_media_time, tvb, offset, field_length, media_time, - "Media time: %s (%" G_GINT64_FORMAT ")", + "Media time: %s (%" PRId64 ")", media_time_str, media_time); offset += field_length; diff --git a/epan/dissectors/file-pcapng.c b/epan/dissectors/file-pcapng.c index 70be165ba7..86c2e5dc35 100644 --- a/epan/dissectors/file-pcapng.c +++ b/epan/dissectors/file-pcapng.c @@ -837,7 +837,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } else if (value_u64 == 1000000000) { const_str = "1 Gbps"; } else { - const_str = wmem_strdup_printf(pinfo->pool, "%"G_GUINT64_FORMAT, value_u64); + const_str = wmem_strdup_printf(pinfo->pool, "%"PRIu64, value_u64); } proto_item_append_text(p_item, "%s", const_str); proto_item_append_text(option_item, " = %s", const_str); @@ -1018,7 +1018,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_timestamp_offset, tvb, offset, 8, encoding, &value_u64); offset += 8; - proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64); + proto_item_append_text(option_item, " = %"PRIu64, value_u64); if (interface_description) { interface_description->timestamp_offset = value_u64; @@ -1151,7 +1151,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_received, tvb, offset, 8, encoding, &value_u64); - proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64); + proto_item_append_text(option_item, " = %"PRIu64, value_u64); offset += 8; break; @@ -1163,7 +1163,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_dropped, tvb, offset, 8, encoding, &value_u64); - proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64); + proto_item_append_text(option_item, " = %"PRIu64, value_u64); offset += 8; break; @@ -1175,7 +1175,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_accepted_by_filter, tvb, offset, 8, encoding, &value_u64); - proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64); + proto_item_append_text(option_item, " = %"PRIu64, value_u64); offset += 8; break; @@ -1187,7 +1187,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_dropped_by_os, tvb, offset, 8, encoding, &value_u64); - proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64); + proto_item_append_text(option_item, " = %"PRIu64, value_u64); offset += 8; break; @@ -1199,7 +1199,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_interface_delivered_to_user, tvb, offset, 8, encoding, &value_u64); - proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64); + proto_item_append_text(option_item, " = %"PRIu64, value_u64); offset += 8; break; @@ -1249,7 +1249,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_packet_drop_count, tvb, offset, 8, encoding, &value_u64); - proto_item_append_text(option_item, " = %"G_GUINT64_FORMAT, value_u64); + proto_item_append_text(option_item, " = %"PRIu64, value_u64); offset += 8; break; @@ -1261,7 +1261,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, } proto_tree_add_item_ret_uint64(option_tree, hf_pcapng_option_data_packet_id, tvb, offset, 8, encoding, &value_u64); - proto_item_append_text(option_item, " = 0x%016"G_GINT64_MODIFIER"x", value_u64); + proto_item_append_text(option_item, " = 0x%016"PRIx64, value_u64); offset += 8; break; diff --git a/epan/dissectors/packet-5co-legacy.c b/epan/dissectors/packet-5co-legacy.c index 632d09a3ab..54c9c75410 100644 --- a/epan/dissectors/packet-5co-legacy.c +++ b/epan/dissectors/packet-5co-legacy.c @@ -878,7 +878,7 @@ dispType( gchar *result, guint32 type) { int nValueH = (type>>16) & 0xFFFF; int nValueL = (type & 0xFFFF); - g_snprintf( result, 18, "%d.%d (%.4X.%.4X)", nValueH, nValueL, nValueH, nValueL); + snprintf( result, 18, "%d.%d (%.4X.%.4X)", nValueH, nValueL, nValueH, nValueL); } static void @@ -888,7 +888,7 @@ dispVersion( gchar *result, guint32 version) { int nValueH = (version>>16) & 0xFFFF; int nValueL = (version & 0xFFFF); - g_snprintf( result, 11, "FW: %d.%d", nValueH, nValueL); + snprintf( result, 11, "FW: %d.%d", nValueH, nValueL); } else { @@ -896,7 +896,7 @@ dispVersion( gchar *result, guint32 version) int nHWLow = (version>>16) & 0xFF; int nFWHigh = (version>>8) & 0xFF; int nFWLow = (version>>8) & 0xFF; - g_snprintf( result, 25, "HW: %d.%d / FW: %d.%d", nHWHigh, nHWLow, nFWHigh, nFWLow); + snprintf( result, 25, "HW: %d.%d / FW: %d.%d", nHWHigh, nHWLow, nFWHigh, nFWLow); } } @@ -904,7 +904,7 @@ static void dispMAC( gchar *result, guint64 mac) { guint8 *pData = (guint8*)(&mac); - g_snprintf( result, 18, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", pData[5], pData[4], pData[3], pData[2], + snprintf( result, 18, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", pData[5], pData[4], pData[3], pData[2], pData[1], pData[0]); } @@ -912,22 +912,22 @@ static void dispIP( gchar *result, guint32 ip) { guint8 *pData = (guint8*)(&ip); - g_snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]); + snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]); } static void dispMask( gchar *result, guint32 mask) { guint8 *pData = (guint8*)(&mask); - g_snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]); + snprintf( result, 15, "%d.%d.%d.%d", pData[3], pData[2], pData[1], pData[0]); } static void dispTimeout( gchar *result, guint32 timeout) { if (timeout != 0) - g_snprintf( result, 12, "%d secondes", timeout); + snprintf( result, 12, "%d secondes", timeout); else - g_snprintf( result, 8, "Disabled"); + snprintf( result, 8, "Disabled"); } /* diff --git a/epan/dissectors/packet-9p.c b/epan/dissectors/packet-9p.c index 3d70bb8d41..da21489691 100644 --- a/epan/dissectors/packet-9p.c +++ b/epan/dissectors/packet-9p.c @@ -2115,7 +2115,7 @@ static void dissect_9P_qid(tvbuff_t *tvb, proto_tree *tree, int offset) path = tvb_get_letoh64(tvb, offset+1+4); qid_tree = proto_tree_add_subtree_format(tree, tvb, offset, 13, ett_9P_qid, NULL, - "Qid type=0x%02x vers=%d path=%" G_GINT64_MODIFIER "u", type, vers, path); + "Qid type=0x%02x vers=%d path=%" PRIu64, type, vers, path); qidtype_item = proto_tree_add_item(qid_tree, hf_9P_qidtype, tvb, offset, 1, ENC_LITTLE_ENDIAN); qidtype_tree = proto_item_add_subtree(qidtype_item, ett_9P_qidtype); diff --git a/epan/dissectors/packet-aarp.c b/epan/dissectors/packet-aarp.c index 0206ba5e3e..ceff2b41fe 100644 --- a/epan/dissectors/packet-aarp.c +++ b/epan/dissectors/packet-aarp.c @@ -99,7 +99,7 @@ tvb_atalkid_to_str(tvbuff_t *tvb, gint offset) cur=(gchar *)wmem_alloc(wmem_packet_scope(), 16); node=tvb_get_guint8(tvb, offset+1)<<8|tvb_get_guint8(tvb, offset+2); - g_snprintf(cur, 16, "%d.%d",node,tvb_get_guint8(tvb, offset+3)); + snprintf(cur, 16, "%d.%d",node,tvb_get_guint8(tvb, offset+3)); return cur; } diff --git a/epan/dissectors/packet-acdr.c b/epan/dissectors/packet-acdr.c index 308cf4f753..ce0650f70f 100644 --- a/epan/dissectors/packet-acdr.c +++ b/epan/dissectors/packet-acdr.c @@ -432,7 +432,7 @@ create_full_session_id_subtree(proto_tree *tree, tvbuff_t *tvb, int offset, guin session_int = tvb_get_ntoh40(tvb, offset + 4); if (session_int != 0) - session_ext = wmem_strdup_printf(wmem_packet_scope(), ":%" G_GINT64_MODIFIER "u", session_int); + session_ext = wmem_strdup_printf(wmem_packet_scope(), ":%" PRIu64, session_int); str = wmem_strdup_printf(wmem_packet_scope(), "%x:%d%s", board_id, reset_counter, session_ext); } diff --git a/epan/dissectors/packet-acn.c b/epan/dissectors/packet-acn.c index f57f4b9154..3a11100fb8 100644 --- a/epan/dissectors/packet-acn.c +++ b/epan/dissectors/packet-acn.c @@ -5531,7 +5531,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_string(pdu_tree, hf_acn_dmx_data, tvb, data_offset, dmx_count, buffer); /* start our line */ - g_snprintf(buffer, BUFFER_SIZE, "001-%03d: ", perline); + snprintf(buffer, BUFFER_SIZE, "001-%03d: ", perline); buf_ptr = buffer + 9; total_cnt = 0; @@ -5553,7 +5553,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, /* add leader... */ proto_tree_add_string_format(pdu_tree, hf_acn_dmx_data, tvb, data_offset, item_cnt, buffer, "%s", buffer); data_offset += perline; - g_snprintf(buffer, BUFFER_SIZE, "%03d-%03d: ",total_cnt, total_cnt+perline); + snprintf(buffer, BUFFER_SIZE, "%03d-%03d: ",total_cnt, total_cnt+perline); buf_ptr = buffer + 9; item_cnt = 0; } else { diff --git a/epan/dissectors/packet-acr122.c b/epan/dissectors/packet-acr122.c index a6f78dd2f1..caa032fb4c 100644 --- a/epan/dissectors/packet-acr122.c +++ b/epan/dissectors/packet-acr122.c @@ -180,19 +180,19 @@ void proto_reg_handoff_acr122(void); static void duration_base(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 100 / 1000, value * 100 % 1000); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 100 / 1000, value * 100 % 1000); } static void timeout_base(gchar *buf, guint32 value) { if (value == 0x00) - g_snprintf(buf, ITEM_LABEL_LENGTH, "No timeout check"); + snprintf(buf, ITEM_LABEL_LENGTH, "No timeout check"); else if (value == 0xFF) - g_snprintf(buf, ITEM_LABEL_LENGTH, "Wait until the contactless chip responds"); + snprintf(buf, ITEM_LABEL_LENGTH, "Wait until the contactless chip responds"); else if (value < 12) - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u [s]", value * 5); + snprintf(buf, ITEM_LABEL_LENGTH, "%u [s]", value * 5); else - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u:%02u [mm:ss]", value * 5 / 60, value * 5 % 60); + snprintf(buf, ITEM_LABEL_LENGTH, "%u:%02u [mm:ss]", value * 5 / 60, value * 5 % 60); } diff --git a/epan/dissectors/packet-aeron.c b/epan/dissectors/packet-aeron.c index 304da0f673..b1cb5b5c0d 100644 --- a/epan/dissectors/packet-aeron.c +++ b/epan/dissectors/packet-aeron.c @@ -676,11 +676,11 @@ static char * aeron_format_transport_uri(const aeron_conversation_info_t * cinfo switch (cinfo->addr2->type) { case AT_IPv6: - wmem_strbuf_append_printf(uri, "group=[%s]:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); + wmem_strbuf_append_printf(uri, "group=[%s]:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); break; case AT_IPv4: default: - wmem_strbuf_append_printf(uri, "group=%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); + wmem_strbuf_append_printf(uri, "group=%s:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); break; } } @@ -689,11 +689,11 @@ static char * aeron_format_transport_uri(const aeron_conversation_info_t * cinfo switch (cinfo->addr2->type) { case AT_IPv6: - wmem_strbuf_append_printf(uri, "remote=[%s]:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); + wmem_strbuf_append_printf(uri, "remote=[%s]:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); break; case AT_IPv4: default: - wmem_strbuf_append_printf(uri, "remote=%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); + wmem_strbuf_append_printf(uri, "remote=%s:%" PRIu16, address_to_str(wmem_packet_scope(), cinfo->addr2), cinfo->port2); break; } } @@ -1546,11 +1546,11 @@ static void aeron_sequence_report_frame(tvbuff_t * tvb, proto_tree * tree, aeron if ((finfo->flags & AERON_FRAME_INFO_FLAGS_RETRANSMISSION) != 0) { - item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" G_GUINT32_FORMAT " (RX)", finfo->frame); + item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" PRIu32 " (RX)", finfo->frame); } else if ((finfo->flags & AERON_FRAME_INFO_FLAGS_KEEPALIVE) != 0) { - item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" G_GUINT32_FORMAT " (KA)", finfo->frame); + item = proto_tree_add_uint_format_value(tree, hf_aeron_sequence_analysis_term_offset_frame, tvb, 0, 0, finfo->frame, "%" PRIu32 " (KA)", finfo->frame); } else { @@ -1704,7 +1704,7 @@ static void aeron_sequence_report(tvbuff_t * tvb, packet_info * pinfo, proto_tre if (rx != NULL) { rx_item = proto_tree_add_uint_format_value(rx_tree, hf_aeron_sequence_analysis_nak_rx_frame, tvb, 0, 0, rx->frame_info->frame, - "%" G_GUINT32_FORMAT ", Term offset=%" G_GUINT32_FORMAT " (0x%08x), Length=%" G_GUINT32_FORMAT, rx->frame_info->frame, rx->term_offset, rx->term_offset, rx->length); + "%" PRIu32 ", Term offset=%" PRIu32 " (0x%08x), Length=%" PRIu32, rx->frame_info->frame, rx->term_offset, rx->term_offset, rx->length); proto_item_set_generated(rx_item); } lf = wmem_list_frame_next(lf); @@ -1864,7 +1864,7 @@ static void aeron_info_stream_progress_report(packet_info * pinfo, guint16 msgty } else { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" G_GUINT32_FORMAT ")", + col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" PRIu32 ")", type_string, term_id, term_offset); } break; @@ -1877,12 +1877,12 @@ static void aeron_info_stream_progress_report(packet_info * pinfo, guint16 msgty { if (finfo->stream_analysis->high.term_id == finfo->stream_analysis->completed.term_id) { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (%" G_GUINT32_FORMAT "/%" G_GUINT32_FORMAT " [%" G_GUINT32_FORMAT "])", + col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (%" PRIu32 "/%" PRIu32 " [%" PRIu32 "])", type_string, finfo->stream_analysis->high.term_offset, finfo->stream_analysis->completed.term_offset, finfo->stream_analysis->outstanding_bytes); } else { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" G_GUINT32_FORMAT "/0x%08x:%" G_GUINT32_FORMAT " [%" G_GUINT32_FORMAT "])", + col_append_sep_fstr(pinfo->cinfo, COL_INFO, ", ", "%s (0x%08x:%" PRIu32 "/0x%08x:%" PRIu32 " [%" PRIu32 "])", type_string, finfo->stream_analysis->high.term_id, finfo->stream_analysis->high.term_offset, finfo->stream_analysis->completed.term_id, finfo->stream_analysis->completed.term_offset, finfo->stream_analysis->outstanding_bytes); } } @@ -2255,7 +2255,7 @@ static int dissect_aeron_pad(tvbuff_t * tvb, int offset, packet_info * pinfo, pr return 0; aeron_info_stream_progress_report(pinfo, HDR_TYPE_PAD, pktinfo.flags, term_id, term_offset, finfo); - pad_item = proto_tree_add_none_format(tree, hf_aeron_pad, tvb, offset, -1, "Pad Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT "(%d)", + pad_item = proto_tree_add_none_format(tree, hf_aeron_pad, tvb, offset, -1, "Pad Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32 "(%d)", term_id, term_offset, frame_length, rounded_length); subtree = proto_item_add_subtree(pad_item, ett_aeron_pad); channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id); @@ -2303,7 +2303,7 @@ static void dissect_aeron_reassembled_data(packet_info * pinfo, proto_tree * tre msg->reassembled_data, 0, tvb_reported_length_remaining(msg->reassembled_data, 0), - "%" G_GUINT32_FORMAT " Reassembled Fragments (%" G_GUINT32_FORMAT " bytes):", + "%" PRIu32 " Reassembled Fragments (%" PRIu32 " bytes):", msg->fragment_count, msg->length); frag_tree = proto_item_add_subtree(frag_item, ett_aeron_data_reassembly); @@ -2320,7 +2320,7 @@ static void dissect_aeron_reassembled_data(packet_info * pinfo, proto_tree * tre msg_ofs, frag->data_length, frag->frame, - "Frame: %" G_GUINT32_FORMAT ", payload: %" G_GUINT32_FORMAT "-%" G_GUINT32_FORMAT " (%" G_GUINT32_FORMAT " bytes)", + "Frame: %" PRIu32 ", payload: %" PRIu32 "-%" PRIu32 " (%" PRIu32 " bytes)", frag->frame, msg_ofs, (msg_ofs + frag->data_length) - 1, @@ -2328,11 +2328,11 @@ static void dissect_aeron_reassembled_data(packet_info * pinfo, proto_tree * tre proto_item_set_generated(pi); if (first_item) { - proto_item_append_text(frag_item, " #%" G_GUINT32_FORMAT "(%" G_GUINT32_FORMAT ")", frag->frame, frag->data_length); + proto_item_append_text(frag_item, " #%" PRIu32 "(%" PRIu32 ")", frag->frame, frag->data_length); } else { - proto_item_append_text(frag_item, ", #%" G_GUINT32_FORMAT "(%" G_GUINT32_FORMAT ")", frag->frame, frag->data_length); + proto_item_append_text(frag_item, ", #%" PRIu32 "(%" PRIu32 ")", frag->frame, frag->data_length); } msg_ofs += frag->data_length; first_item = FALSE; @@ -2399,7 +2399,7 @@ static int dissect_aeron_data(tvbuff_t * tvb, int offset, packet_info * pinfo, p return 0; aeron_info_stream_progress_report(pinfo, HDR_TYPE_DATA, pktinfo.flags, term_id, term_offset, finfo); - data_item = proto_tree_add_none_format(tree, hf_aeron_data, tvb, offset, -1, "Data Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT "(%d)", + data_item = proto_tree_add_none_format(tree, hf_aeron_data, tvb, offset, -1, "Data Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32 "(%d)", (guint32) term_id, term_offset, frame_length, rounded_length); subtree = proto_item_add_subtree(data_item, ett_aeron_data); channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id); @@ -2505,7 +2505,7 @@ static int dissect_aeron_nak(tvbuff_t * tvb, int offset, packet_info * pinfo, pr return 0; col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "NAK"); - nak_item = proto_tree_add_none_format(tree, hf_aeron_nak, tvb, offset, -1, "NAK Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT, + nak_item = proto_tree_add_none_format(tree, hf_aeron_nak, tvb, offset, -1, "NAK Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32, term_id, nak_term_offset, nak_length); subtree = proto_item_add_subtree(nak_item, ett_aeron_nak); channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id); @@ -2519,7 +2519,7 @@ static int dissect_aeron_nak(tvbuff_t * tvb, int offset, packet_info * pinfo, pr proto_tree_add_item(subtree, hf_aeron_nak_term_id, tvb, offset + O_AERON_NAK_TERM_ID, 4, ENC_LITTLE_ENDIAN); nak_offset_item = proto_tree_add_item(subtree, hf_aeron_nak_term_offset, tvb, offset + O_AERON_NAK_TERM_OFFSET, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(subtree, hf_aeron_nak_length, tvb, offset + O_AERON_NAK_LENGTH, 4, ENC_LITTLE_ENDIAN); - expert_add_info_format(pinfo, nak_offset_item, &ei_aeron_analysis_nak, "NAK offset %" G_GUINT32_FORMAT " length %" G_GUINT32_FORMAT, nak_term_offset, nak_length); + expert_add_info_format(pinfo, nak_offset_item, &ei_aeron_analysis_nak, "NAK offset %" PRIu32 " length %" PRIu32, nak_term_offset, nak_length); aeron_sequence_report(tvb, pinfo, subtree, transport, &pktinfo, finfo); proto_item_set_len(nak_item, rounded_length); if (frame_length != L_AERON_NAK) @@ -2606,7 +2606,7 @@ static int dissect_aeron_sm(tvbuff_t * tvb, int offset, packet_info * pinfo, pro return 0; aeron_info_stream_progress_report(pinfo, HDR_TYPE_SM, pktinfo.flags, term_id, consumption_offset, finfo); - sm_item = proto_tree_add_none_format(tree, hf_aeron_sm, tvb, offset, -1, "Status Message: Term 0x%x, ConsumptionOfs %" G_GUINT32_FORMAT ", RcvWindow %" G_GUINT32_FORMAT ", RcvID %" G_GUINT64_FORMAT, + sm_item = proto_tree_add_none_format(tree, hf_aeron_sm, tvb, offset, -1, "Status Message: Term 0x%x, ConsumptionOfs %" PRIu32 ", RcvWindow %" PRIu32 ", RcvID %" PRIu64, term_id, consumption_offset, rcv_window, rcv_id); subtree = proto_item_add_subtree(sm_item, ett_aeron_sm); item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id); @@ -2725,7 +2725,7 @@ static int dissect_aeron_heartbeat(tvbuff_t * tvb, int offset, packet_info * pin return 0; aeron_info_stream_progress_report(pinfo, HDR_TYPE_DATA, pktinfo.flags, term_id, term_offset, finfo); - data_item = proto_tree_add_none_format(tree, hf_aeron_heartbeat, tvb, offset, -1, "Heartbeat Frame: Term 0x%x, Ofs %" G_GUINT32_FORMAT ", Len %" G_GUINT32_FORMAT "(%d)", + data_item = proto_tree_add_none_format(tree, hf_aeron_heartbeat, tvb, offset, -1, "Heartbeat Frame: Term 0x%x, Ofs %" PRIu32 ", Len %" PRIu32 "(%d)", (guint32) term_id, term_offset, frame_length, rounded_length); subtree = proto_item_add_subtree(data_item, ett_aeron_data); channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id); @@ -2780,7 +2780,7 @@ static int dissect_aeron_rtt(tvbuff_t * tvb, int offset, packet_info * pinfo, pr stream_id = tvb_get_letohl(tvb, offset + O_AERON_RTT_STREAM_ID); rcv_id = tvb_get_letoh64(tvb, offset + O_AERON_RTT_RECEIVER_ID); - rtt_item = proto_tree_add_none_format(tree, hf_aeron_rtt, tvb, offset, -1, "RTT Message: Stream ID %" G_GUINT32_FORMAT ", RcvID %" G_GUINT64_FORMAT, + rtt_item = proto_tree_add_none_format(tree, hf_aeron_rtt, tvb, offset, -1, "RTT Message: Stream ID %" PRIu32 ", RcvID %" PRIu64, stream_id, rcv_id); subtree = proto_item_add_subtree(rtt_item, ett_aeron_rtt); item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id); @@ -2870,7 +2870,7 @@ static int dissect_aeron_setup(tvbuff_t * tvb, int offset, packet_info * pinfo, col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "Setup"); setup_item = proto_tree_add_none_format(tree, hf_aeron_setup, tvb, offset, -1, - "Setup Frame: InitTerm 0x%x, ActiveTerm 0x%x, TermLen %" G_GUINT32_FORMAT ", Ofs %" G_GUINT32_FORMAT ", MTU %" G_GUINT32_FORMAT ", TTL %" G_GUINT32_FORMAT, + "Setup Frame: InitTerm 0x%x, ActiveTerm 0x%x, TermLen %" PRIu32 ", Ofs %" PRIu32 ", MTU %" PRIu32 ", TTL %" PRIu32, initial_term_id, (guint32) active_term_id, term_length, term_offset, mtu, ttl); subtree = proto_item_add_subtree(setup_item, ett_aeron_setup); channel_item = proto_tree_add_uint64(subtree, hf_aeron_channel_id, tvb, 0, 0, transport->channel_id); diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c index 9107402e15..c03749dbcb 100644 --- a/epan/dissectors/packet-afp.c +++ b/epan/dissectors/packet-afp.c @@ -4457,26 +4457,26 @@ dissect_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat toc_offset = (tvb_get_guint64(tvb, offset, encoding) >> 32) * 8; if (toc_offset < 8) { ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset); - expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u < 8 (bogus)", toc_offset); + expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " < 8 (bogus)", toc_offset); return tvb_captured_length(tvb); } toc_offset -= 8; if (offset + toc_offset + 8 > G_MAXINT) { ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset); - expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u > %u (bogus)", toc_offset, G_MAXINT - 8 - offset); + expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " > %u (bogus)", toc_offset, G_MAXINT - 8 - offset); return tvb_captured_length(tvb); } querylen = (tvb_get_guint64(tvb, offset, encoding) & 0xffffffff) * 8; if (querylen < 8) { ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset); - expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u Bytes, Query length: %" G_GINT64_MODIFIER "u < 8 (bogus)", + expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " Bytes, Query length: %" PRIu64 " < 8 (bogus)", toc_offset, querylen); return tvb_captured_length(tvb); } querylen -= 8; if (querylen > G_MAXINT) { ti = proto_tree_add_uint64(tree, hf_afp_toc_offset, tvb, offset, 8, toc_offset); - expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" G_GINT64_MODIFIER "u Bytes, Query length: %" G_GINT64_MODIFIER "u > %u (bogus)", + expert_add_info_format(pinfo, ti, &ei_afp_toc_offset, "%" PRIu64 " Bytes, Query length: %" PRIu64 " > %u (bogus)", toc_offset, querylen, G_MAXINT); return tvb_captured_length(tvb); } @@ -4518,20 +4518,20 @@ dissect_spotlight(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat case SQ_CPX_TYPE_ARRAY: case SQ_CPX_TYPE_DICT: proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry, - "%u: count: %" G_GINT64_MODIFIER "u, type: %s, offset: %" G_GINT64_MODIFIER "u", + "%u: count: %" PRIu64 ", type: %s, offset: %" PRIu64, i+1, toc_entry >> 32, val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"), (toc_entry & 0xffff) * 8); break; case SQ_CPX_TYPE_STRING: case SQ_CPX_TYPE_UTF16_STRING: proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry, - "%u: pad byte count: %" G_GINT64_MODIFIER "x, type: %s, offset: %" G_GINT64_MODIFIER "u", + "%u: pad byte count: %" PRIx64 ", type: %s, offset: %" PRIu64, i+1, 8 - (toc_entry >> 32), val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"), (toc_entry & 0xffff) * 8); break; default: proto_tree_add_uint64_format(sub_tree_toc, hf_afp_toc_entry, tvb, offset, 8, toc_entry, - "%u: unknown: 0x%08" G_GINT64_MODIFIER "x, type: %s, offset: %" G_GINT64_MODIFIER "u", + "%u: unknown: 0x%08" PRIx64 ", type: %s, offset: %" PRIu64, i+1, toc_entry >> 32, val64_to_str_const((toc_entry & 0xffff0000) >> 16, cpx_qtype_string_values, "Unknown"), (toc_entry & 0xffff) * 8); } diff --git a/epan/dissectors/packet-agentx.c b/epan/dissectors/packet-agentx.c index b675e64707..6c18c871a2 100644 --- a/epan/dissectors/packet-agentx.c +++ b/epan/dissectors/packet-agentx.c @@ -313,11 +313,11 @@ convert_oid_to_str(guint32 *oid, int len, char* str, int slen, char prefix) if(slen < len) return 0; if(prefix) { - tlen += g_snprintf(str, slen, ".1.3.6.1.%d", prefix); + tlen += snprintf(str, slen, ".1.3.6.1.%d", prefix); } for(i=0; i < len && tlen < slen; i++) { - tlen += g_snprintf(str+tlen, slen-tlen, ".%d", oid[i]); + tlen += snprintf(str+tlen, slen-tlen, ".%d", oid[i]); } return tlen; } @@ -346,7 +346,7 @@ dissect_object_id(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 flags, enu } if(!convert_oid_to_str(&oid[0], n_subid, &str_oid[0], 2048, prefix)) - g_snprintf(&str_oid[0], 2048, "(null)"); + snprintf(&str_oid[0], 2048, "(null)"); if(tree) { const char *range = ""; diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c index 06c55bf2d3..faf641680b 100644 --- a/epan/dissectors/packet-aim.c +++ b/epan/dissectors/packet-aim.c @@ -2418,7 +2418,7 @@ aim_generic_family( gchar *result, guint32 famnum ) { const aim_family *family = aim_get_family(famnum); - g_snprintf( result, ITEM_LABEL_LENGTH, "%s (0x%x)", family?family->name:"Unknown", famnum); + snprintf( result, ITEM_LABEL_LENGTH, "%s (0x%x)", family?family->name:"Unknown", famnum); } static const aim_subtype aim_fnac_family_generic[] = { diff --git a/epan/dissectors/packet-alljoyn.c b/epan/dissectors/packet-alljoyn.c index d0aa5b6341..74ad7d867d 100644 --- a/epan/dissectors/packet-alljoyn.c +++ b/epan/dissectors/packet-alljoyn.c @@ -1289,7 +1289,7 @@ parse_arg(tvbuff_t *tvb, static void alljoyn_typeid( gchar *result, guint32 type ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "'%c' => ", type); + snprintf( result, ITEM_LABEL_LENGTH, "'%c' => ", type); } /* This is called by handle_message_header_fields() to handle a single diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c index e87385f600..2cf1738037 100644 --- a/epan/dissectors/packet-amqp.c +++ b/epan/dissectors/packet-amqp.c @@ -2414,7 +2414,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin amqp_typename = "integer"; if (length < 4) return 0; /* too short */ - value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT32_MODIFIER "i", + value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi32, tvb_get_ntohil(tvb, offset)); offset += 4; break; @@ -2496,7 +2496,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin amqp_typename = "short int"; if (length < 2) return 0; /* too short */ - value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT16_MODIFIER "i", + value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi16, tvb_get_ntohis(tvb, offset)); offset += 2; break; @@ -2504,7 +2504,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin amqp_typename = "short uint"; if (length < 2) return 0; /* too short */ - value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT16_MODIFIER "u", + value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIu16, tvb_get_ntohs(tvb, offset)); offset += 2; break; @@ -2512,7 +2512,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin amqp_typename = "unsigned integer"; if (length < 4) return 0; /* too short */ - value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT32_MODIFIER "u", + value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIu32, tvb_get_ntohl(tvb, offset)); offset += 4; break; @@ -2520,7 +2520,7 @@ dissect_amqp_0_9_field_value(tvbuff_t *tvb, packet_info *pinfo, int offset, guin amqp_typename = "long int"; if (length < 8) return 0; /* too short */ - value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "i", + value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi64, tvb_get_ntohi64(tvb, offset)); offset += 8; break; @@ -10368,7 +10368,7 @@ format_amqp_1_0_uint(tvbuff_t *tvb, *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid uint length %d!", length); return length; } - *value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "u", val); + *value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIu64, val); return length; } @@ -10392,7 +10392,7 @@ format_amqp_1_0_int(tvbuff_t *tvb, *value = wmem_strdup_printf(wmem_packet_scope(), "Invalid int length %d!", length); return length; } - *value = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_MODIFIER "i", val); + *value = wmem_strdup_printf(wmem_packet_scope(), "%" PRIi64, val); return length; } @@ -10695,7 +10695,7 @@ format_amqp_0_10_sequence_set(tvbuff_t *tvb, guint offset, guint length, static void amqp_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "AMQP version as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "AMQP version as"); } static gpointer amqp_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c index 5a25f914c6..1ad7fa3aa1 100644 --- a/epan/dissectors/packet-ansi_637.c +++ b/epan/dissectors/packet-ansi_637.c @@ -1947,7 +1947,7 @@ trans_param_tele_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint l "%s (%u)", str, value); - g_snprintf(add_string, string_len, " - %s (%u)", str, value); + snprintf(add_string, string_len, " - %s (%u)", str, value); } static void @@ -1966,7 +1966,7 @@ trans_param_srvc_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint "%s (%u)", str, value); - g_snprintf(add_string, string_len, " - %s (%u)", str, value); + snprintf(add_string, string_len, " - %s (%u)", str, value); if ((value >= ANSI_TSB58_SRVC_CAT_CMAS_MIN) && (value <= ANSI_TSB58_SRVC_CAT_CMAS_MAX)) { @@ -2205,7 +2205,7 @@ trans_param_bearer_reply_opt(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree * proto_tree_add_item(tree, hf_ansi_637_trans_bearer_reply_seq_num, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_ansi_637_reserved_bits_8_03, tvb, offset, 1, ENC_BIG_ENDIAN); - g_snprintf(add_string, string_len, " - Reply Sequence Number (%u)", + snprintf(add_string, string_len, " - Reply Sequence Number (%u)", (tvb_get_guint8(tvb, offset) & 0xfc) >> 2); } @@ -2228,7 +2228,7 @@ trans_param_cause_codes(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, oct = tvb_get_guint8(tvb, offset); - g_snprintf(add_string, string_len, " - Reply Sequence Number (%u)", (oct & 0xfc) >> 2); + snprintf(add_string, string_len, " - Reply Sequence Number (%u)", (oct & 0xfc) >> 2); if (!(oct & 0x03)) return; diff --git a/epan/dissectors/packet-aprs.c b/epan/dissectors/packet-aprs.c index dd808e1680..81fd867561 100644 --- a/epan/dissectors/packet-aprs.c +++ b/epan/dissectors/packet-aprs.c @@ -588,7 +588,7 @@ dissect_mic_e( tvbuff_t *tvb, if ( cse >= 400 ) cse -= 400; - g_snprintf( info_buffer, STRLEN, + snprintf( info_buffer, STRLEN, "Lat: %7.7s%c Long: %03d%02d.%02d%c, Cse: %d, Spd: %d, SSID: %d, Msg %s", latitude, n_s, @@ -610,7 +610,7 @@ dissect_mic_e( tvbuff_t *tvb, tc = proto_tree_add_string( parent_tree, hf_mic_e_idx, tvb, offset, data_len, info_buffer ); mic_e_tree = proto_item_add_subtree( tc, ett_aprs_mic_e ); - g_snprintf( info_buffer, STRLEN, + snprintf( info_buffer, STRLEN, "Lat %7.7s, Msg A %d, Msg B %d, Msg C %d, N/S %c, Long off %3d, W/E %c, SSID %d", latitude, msg_a, @@ -882,7 +882,7 @@ aprs_latitude_compressed( proto_tree *aprs_tree, tvbuff_t *tvb, int offset ) temp = ( tvb_get_guint8( tvb, offset + 2 ) - 33 ) + ( temp * 91 ); temp = ( tvb_get_guint8( tvb, offset + 3 ) - 33 ) + ( temp * 91 ); - g_snprintf( info_buffer, STRLEN, "%6.2f", 90.0 - (temp / 380926.0) ); + snprintf( info_buffer, STRLEN, "%6.2f", 90.0 - (temp / 380926.0) ); proto_tree_add_string( aprs_tree, hf_aprs_lat, tvb, offset, 4, info_buffer ); } return offset + 4; @@ -903,7 +903,7 @@ aprs_longitude_compressed( proto_tree *aprs_tree, tvbuff_t *tvb, int offset ) temp = ( tvb_get_guint8( tvb, offset + 2 ) - 33 ) + ( temp * 91 ); temp = ( tvb_get_guint8( tvb, offset + 3 ) - 33 ) + ( temp * 91 ); - g_snprintf( info_buffer, STRLEN, "%7.2f", (temp / 190463.0) - 180.0 ); + snprintf( info_buffer, STRLEN, "%7.2f", (temp / 190463.0) - 180.0 ); proto_tree_add_string( aprs_tree, hf_aprs_long, tvb, offset, 4, info_buffer ); } return offset + 4; diff --git a/epan/dissectors/packet-aruba-erm.c b/epan/dissectors/packet-aruba-erm.c index 918154a270..448f001e8a 100644 --- a/epan/dissectors/packet-aruba-erm.c +++ b/epan/dissectors/packet-aruba-erm.c @@ -386,7 +386,7 @@ dissect_aruba_erm_type6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static void aruba_erm_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Aruba ERM payload as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Aruba ERM payload as"); } void diff --git a/epan/dissectors/packet-asphodel.c b/epan/dissectors/packet-asphodel.c index 19d95ecd98..0c3edd9ebf 100644 --- a/epan/dissectors/packet-asphodel.c +++ b/epan/dissectors/packet-asphodel.c @@ -232,7 +232,7 @@ asphodel_fmt_version(gchar *result, guint32 version) guint8 major = version >> 8; guint8 minor = (version >> 4) & 0x0F; guint8 subminor = version & 0x0F; - g_snprintf(result, ITEM_LABEL_LENGTH, "%d.%d.%d", major, minor, subminor); + snprintf(result, ITEM_LABEL_LENGTH, "%d.%d.%d", major, minor, subminor); } static int diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 52c536f980..bef401bc68 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -1746,7 +1746,7 @@ dissect_atm_pw_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static void atm_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode AAL2 traffic as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode AAL2 traffic as"); } static gpointer atm_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-autosar-nm.c b/epan/dissectors/packet-autosar-nm.c index 2d93f06c07..5992396412 100644 --- a/epan/dissectors/packet-autosar-nm.c +++ b/epan/dissectors/packet-autosar-nm.c @@ -236,7 +236,7 @@ static gchar* calc_hf_key(user_data_field_t udf) { gchar* ret = NULL; - ret = g_strdup_printf("%i-%i-%" G_GUINT64_FORMAT "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name); + ret = g_strdup_printf("%i-%i-%" PRIu64 "-%s", udf.udf_offset, udf.udf_length, udf.udf_mask, udf.udf_name); return ret; } diff --git a/epan/dissectors/packet-ax25-kiss.c b/epan/dissectors/packet-ax25-kiss.c index 66fcbf6f9c..c84a992093 100644 --- a/epan/dissectors/packet-ax25-kiss.c +++ b/epan/dissectors/packet-ax25-kiss.c @@ -252,9 +252,9 @@ dissect_ax25_kiss( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, v default : break; } frame_type_text = val_to_str(kiss_type, kiss_frame_types, "Unknown (%u)"); - g_snprintf( info_buffer, STRLEN, "%s, Port %u", frame_type_text, kiss_port ); + snprintf( info_buffer, STRLEN, "%s, Port %u", frame_type_text, kiss_port ); if ( kiss_param_len > 0 ) - g_snprintf( info_buffer, STRLEN, "%s %u, Port %u", frame_type_text, kiss_param, kiss_port ); + snprintf( info_buffer, STRLEN, "%s %u, Port %u", frame_type_text, kiss_param, kiss_port ); offset += kiss_param_len; diff --git a/epan/dissectors/packet-ax25-nol3.c b/epan/dissectors/packet-ax25-nol3.c index 9747d8548d..37f80f83be 100644 --- a/epan/dissectors/packet-ax25-nol3.c +++ b/epan/dissectors/packet-ax25-nol3.c @@ -153,18 +153,18 @@ dissect_ax25_nol3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, vo col_clear( pinfo->cinfo, COL_INFO); offset = 0; - g_snprintf( info_buffer, STRLEN, "Text" ); + snprintf( info_buffer, STRLEN, "Text" ); if ( gPREF_APRS ) { dti = tvb_get_guint8( tvb, offset ); if ( isaprs( dti ) ) - g_snprintf( info_buffer, STRLEN, "APRS" ); + snprintf( info_buffer, STRLEN, "APRS" ); } if ( gPREF_DX ) { if ( tvb_get_guint8( tvb, offset ) == 'D' && tvb_get_guint8( tvb, offset + 1 ) == 'X' ) - g_snprintf( info_buffer, STRLEN, "DX cluster" ); + snprintf( info_buffer, STRLEN, "DX cluster" ); } col_add_str( pinfo->cinfo, COL_INFO, info_buffer ); diff --git a/epan/dissectors/packet-babel.c b/epan/dissectors/packet-babel.c index c2d184dbef..85a2ee406d 100644 --- a/epan/dissectors/packet-babel.c +++ b/epan/dissectors/packet-babel.c @@ -242,7 +242,7 @@ static const char * format_timestamp(const guint32 i) { static char buf[sizeof("0000.000000s")]; - g_snprintf(buf, sizeof(buf), "%u.%06us", i / 1000000, i % 1000000); + snprintf(buf, sizeof(buf), "%u.%06us", i / 1000000, i % 1000000); return buf; } diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c index 2d1f1c1893..f793119f7a 100644 --- a/epan/dissectors/packet-bacapp.c +++ b/epan/dissectors/packet-bacapp.c @@ -7001,7 +7001,7 @@ fUnsignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, /* only support up to an 8 byte (64-bit) integer */ if (fUnsigned64(tvb, offset + tag_len, lvt, &val)) subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, - ett_bacapp_tag, NULL, "%s(Unsigned) %" G_GINT64_MODIFIER "u", label, val); + ett_bacapp_tag, NULL, "%s(Unsigned) %" PRIu64, label, val); else subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, ett_bacapp_tag, NULL, "%s - %u octets (Unsigned)", label, lvt); @@ -7088,7 +7088,7 @@ fSignedTag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, co tag_len = fTagHeader(tvb, pinfo, offset, &tag_no, &tag_info, &lvt); if (fSigned64(tvb, offset + tag_len, lvt, &val)) subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, - ett_bacapp_tag, NULL, "%s(Signed) %" G_GINT64_MODIFIER "d", label, val); + ett_bacapp_tag, NULL, "%s(Signed) %" PRId64, label, val); else subtree = proto_tree_add_subtree_format(tree, tvb, offset, lvt+tag_len, ett_bacapp_tag, NULL, "%s - %u octets (Signed)", label, lvt); @@ -8687,13 +8687,13 @@ fAbstractSyntaxNType(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint gboolean do_default_handling; if (propertyIdentifier >= 0) { - g_snprintf(ar, sizeof(ar), "%s: ", + snprintf(ar, sizeof(ar), "%s: ", val_to_split_str(propertyIdentifier, 512, BACnetPropertyIdentifier, ASHRAE_Reserved_Fmt, Vendor_Proprietary_Fmt)); } else { - g_snprintf(ar, sizeof(ar), "Abstract Type: "); + snprintf(ar, sizeof(ar), "Abstract Type: "); } unsigned recursion_depth = p_get_proto_depth(pinfo, proto_bacapp); @@ -14122,7 +14122,7 @@ fPriorityArray(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset while (tvb_reported_length_remaining(tvb, offset) > 0) { /* exit loop if nothing happens inside */ lastoffset = offset; - g_snprintf(ar, sizeof(ar), "%s[%d]: ", + snprintf(ar, sizeof(ar), "%s[%d]: ", val_to_split_str(87 , 512, BACnetPropertyIdentifier, ASHRAE_Reserved_Fmt, diff --git a/epan/dissectors/packet-banana.c b/epan/dissectors/packet-banana.c index b5b157c8f2..a79b68dae8 100644 --- a/epan/dissectors/packet-banana.c +++ b/epan/dissectors/packet-banana.c @@ -144,7 +144,7 @@ dissect_banana_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int switch (byte) { case BE_LIST: if (val > MAX_ELEMENT_VAL) { - expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "List length %" G_GINT64_MODIFIER "d longer than we can handle", val); + expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "List length %" PRId64 " longer than we can handle", val); } ti = proto_tree_add_uint_format_value(tree, hf_banana_list, tvb, start_offset, offset - start_offset - 1, (guint32) val, "(%d items)", (gint) val); list_tree = proto_item_add_subtree(ti, ett_list); @@ -158,20 +158,20 @@ dissect_banana_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int break; case BE_INT: if (val > MAX_ELEMENT_VAL) { - expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value %" G_GINT64_MODIFIER "d too large", val); + expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value %" PRId64 " too large", val); } proto_tree_add_uint(tree, hf_banana_int, tvb, start_offset, offset - start_offset, (guint32) val); break; case BE_STRING: if (val > MAX_ELEMENT_VAL) { - expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "String length %" G_GINT64_MODIFIER "d longer than we can handle", val); + expert_add_info_format(pinfo, NULL, &ei_banana_length_too_long, "String length %" PRId64 " longer than we can handle", val); } proto_tree_add_item(tree, hf_banana_string, tvb, offset, (guint32) val, ENC_ASCII|ENC_NA); offset += (gint) val; break; case BE_NEG_INT: if (val > MAX_ELEMENT_VAL) { - expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value -%" G_GINT64_MODIFIER "d too large", val); + expert_add_info_format(pinfo, NULL, &ei_banana_value_too_large, "Integer value -%" PRId64 " too large", val); } proto_tree_add_int(tree, hf_banana_neg_int, tvb, start_offset, offset - start_offset, (gint32) val * -1); break; diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index 2753dfe54e..d1bcd77683 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -362,7 +362,7 @@ static uat_field_t users_flds[] = { static void ber_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode ASN.1 file as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode ASN.1 file as"); } static gpointer ber_value(packet_info *pinfo _U_) @@ -534,12 +534,12 @@ ber_check_value64 (gint64 value, gint64 min_len, gint64 max_len, asn1_ctx_t *act if ((min_len != -1) && (value < min_len)) { expert_add_info_format( actx->pinfo, item, &ei_ber_size_constraint_value, - "Size constraint: value too small: %" G_GINT64_MODIFIER "d (%" G_GINT64_MODIFIER "d .. %" G_GINT64_MODIFIER "d)", + "Size constraint: value too small: %" PRId64 " (%" PRId64" .. %" PRId64 ")", value, min_len, max_len); } else if ((max_len != -1) && (value > max_len)) { expert_add_info_format( actx->pinfo, item, &ei_ber_size_constraint_value, - "Size constraint: value too big: %" G_GINT64_MODIFIER "d (%" G_GINT64_MODIFIER "d .. %" G_GINT64_MODIFIER "d)", + "Size constraint: value too big: %" PRId64 " (%" PRId64 " .. %" PRId64 ")", value, min_len, max_len); } } @@ -3743,7 +3743,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t goto malformed; } } - g_snprintf(outstrptr, 15, "%.2s-%.2s-%.2s %.2s:%.2s", instr, instr+2, instr+4, instr+6, instr+8); + snprintf(outstrptr, 15, "%.2s-%.2s-%.2s %.2s:%.2s", instr, instr+2, instr+4, instr+6, instr+8); outstrptr+= 14; /* (ss)? */ @@ -3752,7 +3752,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t i++; if ((instr[i] >= '0') && (instr[i] <= '9')) { i++; - g_snprintf(outstrptr, 4, ":%.2s", instr+10); + snprintf(outstrptr, 4, ":%.2s", instr+10); outstrptr+=3; } else { error_str = "BER Error: malformed UTCTime encoding, " @@ -3771,7 +3771,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t "there must be no further octets after \'Z\'"; goto malformed; } - g_snprintf(outstrptr, 7, " (UTC)"); + snprintf(outstrptr, 7, " (UTC)"); i++; break; case '-': @@ -3788,7 +3788,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t goto malformed; } } - g_snprintf(outstrptr, 12, " (UTC%c%.4s)", instr[i], instr+i+1); + snprintf(outstrptr, 12, " (UTC%c%.4s)", instr[i], instr+i+1); i+=5; break; default: diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index 95140a3dce..1e1356287e 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -9445,8 +9445,8 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len, case AIGP_TLV_TYPE : proto_tree_add_item(subtree3, hf_bgp_aigp_tlv_length, tvb, q+1, 2, ENC_BIG_ENDIAN); proto_tree_add_item(subtree3, hf_bgp_aigp_accu_igp_metric, tvb, q+3, 8, ENC_BIG_ENDIAN); - proto_item_append_text(ti, ": %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, q+3)); - proto_item_append_text(ti_pa, ": %" G_GINT64_MODIFIER "u", tvb_get_ntoh64(tvb, q+3)); + proto_item_append_text(ti, ": %" PRIu64, tvb_get_ntoh64(tvb, q+3)); + proto_item_append_text(ti_pa, ": %" PRIu64, tvb_get_ntoh64(tvb, q+3)); break; default : expert_add_info_format(pinfo, aigp_type_item, &ei_bgp_attr_aigp_type, diff --git a/epan/dissectors/packet-blip.c b/epan/dissectors/packet-blip.c index 81fe063b68..983c7a4bbe 100644 --- a/epan/dissectors/packet-blip.c +++ b/epan/dissectors/packet-blip.c @@ -181,7 +181,7 @@ message_hash_key_convo(packet_info *pinfo, // msgtype:srcport:destport:messagenum const gchar *msg_type = get_message_type(value_frame_flags); - gchar *hash_key = wmem_strdup_printf(pinfo->pool, "%s:%u:%u:%" G_GINT64_MODIFIER "u", + gchar *hash_key = wmem_strdup_printf(pinfo->pool, "%s:%u:%u:%" PRIu64, msg_type, pinfo->srcport, pinfo->destport, value_message_num); return hash_key; @@ -445,7 +445,7 @@ dissect_blip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, _U_ void *data offset += varint_frame_flags_length; const gchar* msg_type = get_message_type(value_frame_flags); - gchar* msg_num = wmem_strdup_printf(pinfo->pool, "#%" G_GUINT64_FORMAT, value_message_num); + gchar* msg_num = wmem_strdup_printf(pinfo->pool, "#%" PRIu64, value_message_num); gchar* col_info = wmem_strconcat(pinfo->pool, msg_type, msg_num, NULL); col_add_str(pinfo->cinfo, COL_INFO, col_info); diff --git a/epan/dissectors/packet-bluetooth.c b/epan/dissectors/packet-bluetooth.c index 2b17b05aec..c52d8634ee 100644 --- a/epan/dissectors/packet-bluetooth.c +++ b/epan/dissectors/packet-bluetooth.c @@ -3472,9 +3472,9 @@ static void bluetooth_uuid_prompt(packet_info *pinfo, gchar* result) value_data = (gchar *) p_get_proto_data(pinfo->pool, pinfo, proto_bluetooth, PROTO_DATA_BLUETOOTH_SERVICE_UUID); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "BT Service UUID %s as", (gchar *) value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "BT Service UUID %s as", (gchar *) value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown BT Service UUID"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown BT Service UUID"); } static gpointer bluetooth_uuid_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-bpsec.c b/epan/dissectors/packet-bpsec.c index 141c0dc817..3215109b86 100644 --- a/epan/dissectors/packet-bpsec.c +++ b/epan/dissectors/packet-bpsec.c @@ -310,7 +310,7 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree gint64 *paramid = wscbor_require_int64(wmem_packet_scope(), chunk_paramid); proto_tree_add_cbor_int64(tree_param_pair, hf_asb_param_id, pinfo, tvb, chunk_paramid, paramid); if (paramid) { - proto_item_append_text(item_param_pair, ", ID: %" G_GINT64_FORMAT, *paramid); + proto_item_append_text(item_param_pair, ", ID: %" PRId64, *paramid); } const gint offset_value = offset; @@ -369,7 +369,7 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree gint64 *resultid = wscbor_require_int64(wmem_packet_scope(), chunk_resultid); proto_tree_add_cbor_int64(tree_result_pair, hf_asb_result_id, pinfo, tvb, chunk_resultid, resultid); if (resultid) { - proto_item_append_text(item_result_pair, ", ID: %" G_GINT64_FORMAT, *resultid); + proto_item_append_text(item_result_pair, ", ID: %" PRId64, *resultid); } const gint offset_value = offset; diff --git a/epan/dissectors/packet-bpv7.c b/epan/dissectors/packet-bpv7.c index 8ad8c1ef38..ea53a7e335 100644 --- a/epan/dissectors/packet-bpv7.c +++ b/epan/dissectors/packet-bpv7.c @@ -733,7 +733,7 @@ proto_item * proto_tree_add_cbor_eid(proto_tree *tree, int hfindex, int hfindex_ const guint64 *service = wscbor_require_uint64(wmem_packet_scope(), chunk); proto_tree_add_cbor_uint64(tree_eid, hf_eid_ipn_service, pinfo, tvb, chunk, service); - wmem_strbuf_append_printf(uribuf, "ipn:%" G_GUINT64_FORMAT ".%" G_GUINT64_FORMAT, node ? *node : 0, service ? *service : 0); + wmem_strbuf_append_printf(uribuf, "ipn:%" PRIu64 ".%" PRIu64, node ? *node : 0, service ? *service : 0); } break; } @@ -908,16 +908,16 @@ static void proto_tree_add_ident(proto_tree *tree, int hfindex, tvbuff_t *tvb, c wmem_strbuf_t *ident_text = wmem_strbuf_new(wmem_packet_scope(), NULL); wmem_strbuf_append_printf( ident_text, - "Source: %s, DTN Time: %" G_GUINT64_FORMAT ", Seq: %" G_GUINT64_FORMAT, + "Source: %s, DTN Time: %" PRIu64 ", Seq: %" PRIu64, ident->src, ident->ts->abstime.dtntime, ident->ts->seqno ); if (ident->frag_offset) { - wmem_strbuf_append_printf(ident_text, ", Frag Offset: %" G_GUINT64_FORMAT, *(ident->frag_offset)); + wmem_strbuf_append_printf(ident_text, ", Frag Offset: %" PRIu64, *(ident->frag_offset)); } if (ident->total_len) { - wmem_strbuf_append_printf(ident_text, ", Total Length: %" G_GUINT64_FORMAT, *(ident->total_len)); + wmem_strbuf_append_printf(ident_text, ", Total Length: %" PRIu64, *(ident->total_len)); } proto_item *item_subj_ident = proto_tree_add_string(tree, hfindex, tvb, 0, 0, wmem_strbuf_get_str(ident_text)); @@ -941,7 +941,7 @@ static gint dissect_block_primary(tvbuff_t *tvb, packet_info *pinfo, proto_tree return offset - start; } #if 0 - proto_item_append_text(item_block, ", Items: %" G_GUINT64_FORMAT, chunk_block->head_value); + proto_item_append_text(item_block, ", Items: %" PRIu64, chunk_block->head_value); #endif wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset); @@ -964,7 +964,7 @@ static gint dissect_block_primary(tvbuff_t *tvb, packet_info *pinfo, proto_tree field_ix++; block->crc_type = (crc_type ? (BundleCrcType)(*crc_type) : BP_CRC_NONE); if (crc_type) { - proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" G_GUINT64_FORMAT)); + proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" PRIu64)); } proto_tree_add_cbor_eid(tree_block, hf_primary_dst_eid, hf_primary_dst_uri, pinfo, tvb, &offset, block->dst_eid); @@ -1063,7 +1063,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre return offset - start; } #if 0 - proto_item_append_text(item_block, ", Items: %" G_GUINT64_FORMAT, chunk_block->head_value); + proto_item_append_text(item_block, ", Items: %" PRIu64, chunk_block->head_value); #endif wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset); @@ -1073,7 +1073,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre block->type_code = type_code; if (type_code) { - proto_item_append_text(item_block, ": %s", val64_to_str(*type_code, blocktype_vals, "Type %" G_GUINT64_FORMAT)); + proto_item_append_text(item_block, ": %s", val64_to_str(*type_code, blocktype_vals, "Type %" PRIu64)); // Check duplicate of this type guint64 limit = UINT64_MAX; @@ -1112,7 +1112,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre field_ix++; block->block_number = block_num; if (block_num) { - proto_item_append_text(item_block, ", Block Num: %" G_GUINT64_FORMAT, *block_num); + proto_item_append_text(item_block, ", Block Num: %" PRIu64, *block_num); } chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset); @@ -1127,7 +1127,7 @@ static gint dissect_block_canonical(tvbuff_t *tvb, packet_info *pinfo, proto_tre field_ix++; block->crc_type = (crc_type ? (BundleCrcType)(*crc_type) : BP_CRC_NONE); if (crc_type) { - proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" G_GUINT64_FORMAT)); + proto_item_append_text(item_block, ", CRC Type: %s", val64_to_str(*crc_type, crc_vals, "%" PRIu64)); } chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset); @@ -1211,7 +1211,7 @@ static void mark_target_block(gpointer key, gpointer value _U_, gpointer user_da const bpsec_block_mark_t *mark = (bpsec_block_mark_t *)user_data; expert_add_info_format( mark->pinfo, mark->pi, mark->eiindex, - "Block is targed by %s block number %" G_GUINT64_FORMAT, mark->sectype, *blk_num + "Block is targed by %s block number %" PRIu64, mark->sectype, *blk_num ); } static void apply_bpsec_mark(const security_mark_t *sec, packet_info *pinfo, proto_item *pi) { @@ -1416,14 +1416,14 @@ static int dissect_bp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void apply_bpsec_mark(&(block->sec), pinfo, block->item_block); } - proto_item_append_text(item_bundle, ", Blocks: %" G_GUINT64_FORMAT, block_ix); + proto_item_append_text(item_bundle, ", Blocks: %" PRIu64, block_ix); if (bundle->primary) { const bp_block_primary_t *block = bundle->primary; proto_item_append_text(item_bundle, ", Dst: %s", block->dst_eid ? block->dst_eid->uri : NULL); proto_item_append_text(item_bundle, ", Src: %s", block->src_nodeid ? block->src_nodeid->uri : NULL); if (bundle->ident && (bundle->ident->ts)) { - proto_item_append_text(item_bundle, ", Time: %" G_GUINT64_FORMAT, bundle->ident->ts->abstime.dtntime); - proto_item_append_text(item_bundle, ", Seq: %" G_GUINT64_FORMAT, bundle->ident->ts->seqno); + proto_item_append_text(item_bundle, ", Time: %" PRIu64, bundle->ident->ts->abstime.dtntime); + proto_item_append_text(item_bundle, ", Seq: %" PRIu64, bundle->ident->ts->seqno); } } { @@ -1494,7 +1494,7 @@ static int dissect_payload_admin(tvbuff_t *tvb, packet_info *pinfo, proto_tree * dissector_handle_t admin_dissect = NULL; if (type_code) { - proto_item_append_text(item_rec, ": %s", val64_to_str(*type_code, admin_type_vals, "Type %" G_GUINT64_FORMAT)); + proto_item_append_text(item_rec, ": %s", val64_to_str(*type_code, admin_type_vals, "Type %" PRIu64)); admin_dissect = dissector_get_custom_table_handle(admin_dissectors, type_code); } tvbuff_t *tvb_record = tvb_new_subset_remaining(tvb, offset); @@ -1652,7 +1652,7 @@ static int dissect_status_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree * status_buf); } if (reason_code) { - proto_item_append_text(item_admin, ", Reason: %s", val64_to_str(*reason_code, status_report_reason_vals, "%" G_GUINT64_FORMAT)); + proto_item_append_text(item_admin, ", Reason: %s", val64_to_str(*reason_code, status_report_reason_vals, "%" PRIu64)); } proto_item_set_len(item_status, offset - chunk_status->start); diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c index da93df96ac..4e5ff9663a 100644 --- a/epan/dissectors/packet-bssgp.c +++ b/epan/dissectors/packet-bssgp.c @@ -701,7 +701,7 @@ de_bssgp_bvci(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o curr_offset+=2; if (add_string) - g_snprintf(add_string, string_len, " - 0x%x", bvci); + snprintf(add_string, string_len, " - 0x%x", bvci); return(curr_offset-offset); @@ -856,7 +856,7 @@ de_bssgp_cell_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of proto_tree_add_item(tree, hf_bssgp_ci, tvb, curr_offset, 2, ENC_BIG_ENDIAN); curr_offset+=2; if (add_string) - g_snprintf(add_string, string_len, "%s, CI %u", add_string, ci); + snprintf(add_string, string_len, "%s, CI %u", add_string, ci); return(curr_offset-offset); @@ -922,7 +922,7 @@ de_bssgp_flush_action(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, g proto_tree_add_item(tree, hf_bssgp_flush_action, tvb, curr_offset, 1, ENC_BIG_ENDIAN); curr_offset+=1; if (add_string) - g_snprintf(add_string, string_len, " - %s", val_to_str_const(oct, bssgp_flush_action_vals, "Reserved")); + snprintf(add_string, string_len, " - %s", val_to_str_const(oct, bssgp_flush_action_vals, "Reserved")); return(curr_offset-offset); @@ -980,7 +980,7 @@ de_bssgp_llc_frames_disc(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_ curr_offset+=1; if (add_string) - g_snprintf(add_string, string_len, " - %u Frames", oct); + snprintf(add_string, string_len, " - %u Frames", oct); return(curr_offset-offset); } @@ -1418,7 +1418,7 @@ de_bssgp_no_of_oct_affected(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo curr_offset+=3; if (add_string) - g_snprintf(add_string, string_len, " - %u", no_of_oct); + snprintf(add_string, string_len, " - %u", no_of_oct); return(curr_offset-offset); } @@ -2310,7 +2310,7 @@ de_bssgp_rim_routing_inf(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gu proto_tree_add_item(tree, hf_bssgp_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN); if (add_string) - g_snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id); + snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id); break; case 2: /* RIM Routing Address discriminator = 0010: @@ -2764,7 +2764,7 @@ de_bssgp_rnc_identifier(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui curr_offset+=2; if (add_string) - g_snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id); + snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id); return(curr_offset-offset); diff --git a/epan/dissectors/packet-btatt.c b/epan/dissectors/packet-btatt.c index 8a753e0a78..57720f9d5d 100644 --- a/epan/dissectors/packet-btatt.c +++ b/epan/dissectors/packet-btatt.c @@ -4031,7 +4031,7 @@ static void helper_base_signed_negative_exponent(gchar * const buf, const gint b { const gint32 signed_value = (const gint32) value; const gint32 fraction = (((signed_value < 0) ? -1 : 1) * signed_value) % base; - g_snprintf(buf, ITEM_LABEL_LENGTH, "%i.%i%s", signed_value / base, fraction, unit); + snprintf(buf, ITEM_LABEL_LENGTH, "%i.%i%s", signed_value / base, fraction, unit); } static void base_signed_one_tenth_unitless(gchar *buf, guint32 value) { @@ -4053,32 +4053,32 @@ static void base_signed_one_hundredth_percentage(gchar *buf, guint32 value) { /* unsigned area */ static void base_unsigned_one_tenth_unitless(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10, value % 10); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10, value % 10); } static void base_unsigned_one_hundredth_km_h(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%02u km/h", value / 100, value % 100); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%02u km/h", value / 100, value % 100); } static void base_unsigned_one_tenth_percentage(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u%%", value / 10, value % 10); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u%%", value / 10, value % 10); } static void base_unsigned_one_tenth_milimeters(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%umm", value / 10, value % 10); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%umm", value / 10, value % 10); } static void base_unsigned_one_half_half_minute(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%um 1/min", value / 2, value % 2); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%um 1/min", value / 2, value % 2); } static void base_unsigned_one_ten_thousandth_unitless(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10000, value % 10000); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u", value / 10000, value % 10000); } static void base_unsigned_one_hundredth_kg_per_meter(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u Kg/m", value / 100, value % 100); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u Kg/m", value / 100, value % 100); } @@ -4158,9 +4158,9 @@ static void btatt_handle_prompt(packet_info *pinfo, gchar* result) value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btatt, PROTO_DATA_BTATT_HANDLE); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "ATT Handle 0x%04x as", (guint) *value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "ATT Handle 0x%04x as", (guint) *value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown ATT Handle"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown ATT Handle"); } static gpointer btatt_handle_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c index 570b807aa5..4ad796d4bc 100644 --- a/epan/dissectors/packet-btavrcp.c +++ b/epan/dissectors/packet-btavrcp.c @@ -1787,7 +1787,7 @@ dissect_vendor_dependent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uid_counter = tvb_get_ntohs(tvb, offset); offset += 2; - col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x", + col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x", val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter); } else { guint status; @@ -1815,7 +1815,7 @@ dissect_vendor_dependent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uid_counter = tvb_get_ntohs(tvb, offset); offset += 2; - col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x", + col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x", val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter); } else { guint status; @@ -1981,7 +1981,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, uid = tvb_get_ntoh64(tvb, offset); offset += 8; - col_append_fstr(pinfo->cinfo, COL_INFO, " - Direction: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x", + col_append_fstr(pinfo->cinfo, COL_INFO, " - Direction: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x", val_to_str_const(direction, direction_vals, "unknown"), uid, uid_counter); } else { guint number_of_items; @@ -2011,7 +2011,7 @@ dissect_browsing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item(tree, hf_btavrcp_number_of_attributes, tvb, offset, 1, ENC_BIG_ENDIAN); number_of_attributes = tvb_get_guint8(tvb, offset); - col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" G_GINT64_MODIFIER "x, UidCounter: 0x%04x", + col_append_fstr(pinfo->cinfo, COL_INFO, " - Scope: %s, Uid: 0x%016" PRIx64 ", UidCounter: 0x%04x", val_to_str_const(scope, scope_vals, "unknown"), uid, uid_counter); offset += 1; diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c index 1021582467..bf500122c3 100644 --- a/epan/dissectors/packet-bthci_acl.c +++ b/epan/dissectors/packet-bthci_acl.c @@ -287,7 +287,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1); remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length); - g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name); + snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name); if (pinfo->p2p_dir == P2P_DIR_RECV) { src_bd_addr = remote_bdaddr->bd_addr; @@ -334,7 +334,7 @@ dissect_bthci_acl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1); localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length); - g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name); + snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name); if (pinfo->p2p_dir == P2P_DIR_RECV) { dst_bd_addr = localhost_bdaddr; diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c index d6ac5d77db..c28623d4f7 100644 --- a/epan/dissectors/packet-bthci_cmd.c +++ b/epan/dissectors/packet-bthci_cmd.c @@ -2593,7 +2593,7 @@ void proto_reg_handoff_btcommon(void); static void bthci_cmd_vendor_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as"); } static gint dissect_coding_format(proto_tree *tree, int hf_x, tvbuff_t *tvb, gint offset, gint ett_x) @@ -8909,9 +8909,9 @@ static void bluetooth_eir_ad_manufacturer_company_id_prompt(packet_info *pinfo, value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btcommon, PROTO_DATA_BLUETOOTH_EIR_AD_MANUFACTURER_COMPANY_ID); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "EIR/AD Manufacturer Company ID 0x%02x as", (guint) *value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "EIR/AD Manufacturer Company ID 0x%02x as", (guint) *value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown EIR/AD Manufacturer"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown EIR/AD Manufacturer"); } static gpointer bluetooth_eir_ad_manufacturer_company_id_value(packet_info *pinfo) @@ -8932,9 +8932,9 @@ static void bluetooth_eir_ad_tds_organization_id_prompt(packet_info *pinfo, gcha value_data = (guint8 *) p_get_proto_data(pinfo->pool, pinfo, proto_btcommon, PROTO_DATA_BLUETOOTH_EIR_AD_TDS_ORGANIZATION_ID); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "TDS Organization ID 0x%02x as", (guint) *value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "TDS Organization ID 0x%02x as", (guint) *value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown TDS Organization ID"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown TDS Organization ID"); } static gpointer bluetooth_eir_ad_tds_organization_id_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c index b114cf2c43..69259b0582 100644 --- a/epan/dissectors/packet-bthci_evt.c +++ b/epan/dissectors/packet-bthci_evt.c @@ -1219,7 +1219,7 @@ void proto_reg_handoff_bthci_evt(void); static void bthci_evt_vendor_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor as"); } static gpointer bthci_evt_vendor_value(packet_info *pinfo _U_) diff --git a/epan/dissectors/packet-bthci_iso.c b/epan/dissectors/packet-bthci_iso.c index 9822f8a6fb..f7926c32c1 100644 --- a/epan/dissectors/packet-bthci_iso.c +++ b/epan/dissectors/packet-bthci_iso.c @@ -252,7 +252,7 @@ dissect_bthci_iso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1); remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length); - g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name); + snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name); if (pinfo->p2p_dir == P2P_DIR_RECV) { set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(remote_name) + 1, remote_name); @@ -309,7 +309,7 @@ dissect_bthci_iso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1); localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length); - g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name); + snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name); if (pinfo->p2p_dir == P2P_DIR_RECV) { set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(localhost_name) + 1, localhost_name); diff --git a/epan/dissectors/packet-bthci_sco.c b/epan/dissectors/packet-bthci_sco.c index 2982448e6e..70c82eced3 100644 --- a/epan/dissectors/packet-bthci_sco.c +++ b/epan/dissectors/packet-bthci_sco.c @@ -182,7 +182,7 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat remote_length = (gint)(strlen(remote_ether_addr) + 3 + strlen(remote_name) + 1); remote_addr_name = (gchar *)wmem_alloc(pinfo->pool, remote_length); - g_snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name); + snprintf(remote_addr_name, remote_length, "%s (%s)", remote_ether_addr, remote_name); if (pinfo->p2p_dir == P2P_DIR_RECV) { set_address(&pinfo->net_src, AT_STRINGZ, (int)strlen(remote_name) + 1, remote_name); @@ -243,7 +243,7 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat localhost_length = (gint)(strlen(localhost_ether_addr) + 3 + strlen(localhost_name) + 1); localhost_addr_name = (gchar *)wmem_alloc(pinfo->pool, localhost_length); - g_snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name); + snprintf(localhost_addr_name, localhost_length, "%s (%s)", localhost_ether_addr, localhost_name); if (pinfo->p2p_dir == P2P_DIR_RECV) { set_address(&pinfo->net_dst, AT_STRINGZ, (int)strlen(localhost_name) + 1, localhost_name); diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c index 97c949479c..02b4ac8588 100644 --- a/epan/dissectors/packet-btl2cap.c +++ b/epan/dissectors/packet-btl2cap.c @@ -480,9 +480,9 @@ static void btl2cap_cid_prompt(packet_info *pinfo, gchar* result) value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_CID); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP CID 0x%04x as", (guint) *value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP CID 0x%04x as", (guint) *value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP CID"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP CID"); } static gpointer btl2cap_cid_value(packet_info *pinfo) @@ -503,9 +503,9 @@ static void btl2cap_psm_prompt(packet_info *pinfo, gchar* result) value_data = (guint16 *) p_get_proto_data(pinfo->pool, pinfo, proto_btl2cap, PROTO_DATA_BTL2CAP_PSM); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP PSM 0x%04x as", (guint) *value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "L2CAP PSM 0x%04x as", (guint) *value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP PSM"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown L2CAP PSM"); } static gpointer btl2cap_psm_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-btle.c b/epan/dissectors/packet-btle.c index dd211f1d76..26cea82c7b 100644 --- a/epan/dissectors/packet-btle.c +++ b/epan/dissectors/packet-btle.c @@ -2378,21 +2378,21 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) switch (direction) { case BTLE_DIR_MASTER_SLAVE: - g_snprintf(str_addr_src, str_addr_len, "Master_0x%08x", connection_info->access_address); - g_snprintf(str_addr_dst, str_addr_len, "Slave_0x%08x", connection_info->access_address); + snprintf(str_addr_src, str_addr_len, "Master_0x%08x", connection_info->access_address); + snprintf(str_addr_dst, str_addr_len, "Slave_0x%08x", connection_info->access_address); set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->master_bd_addr), connection_info->master_bd_addr); set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->slave_bd_addr), connection_info->slave_bd_addr); break; case BTLE_DIR_SLAVE_MASTER: - g_snprintf(str_addr_src, str_addr_len, "Slave_0x%08x", connection_info->access_address); - g_snprintf(str_addr_dst, str_addr_len, "Master_0x%08x", connection_info->access_address); + snprintf(str_addr_src, str_addr_len, "Slave_0x%08x", connection_info->access_address); + snprintf(str_addr_dst, str_addr_len, "Master_0x%08x", connection_info->access_address); set_address(&pinfo->dl_src, AT_ETHER, sizeof(connection_info->slave_bd_addr), connection_info->slave_bd_addr); set_address(&pinfo->dl_dst, AT_ETHER, sizeof(connection_info->master_bd_addr), connection_info->master_bd_addr); break; default: /* BTLE_DIR_UNKNOWN */ - g_snprintf(str_addr_src, str_addr_len, "Unknown_0x%08x", connection_info->access_address); - g_snprintf(str_addr_dst, str_addr_len, "Unknown_0x%08x", connection_info->access_address); + snprintf(str_addr_src, str_addr_len, "Unknown_0x%08x", connection_info->access_address); + snprintf(str_addr_dst, str_addr_len, "Unknown_0x%08x", connection_info->access_address); clear_address(&pinfo->dl_src); clear_address(&pinfo->dl_dst); break; @@ -3766,7 +3766,7 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) sub_item = proto_tree_add_ether(btle_tree, hf_master_bd_addr, tvb, 0, 0, broadcastiso_connection_info->master_bd_addr); proto_item_set_generated(sub_item); - g_snprintf(str_addr_src, str_addr_len, "Master_0x%08x", broadcastiso_connection_info->access_address); + snprintf(str_addr_src, str_addr_len, "Master_0x%08x", broadcastiso_connection_info->access_address); set_address(&pinfo->dl_src, AT_ETHER, sizeof(broadcastiso_connection_info->master_bd_addr), broadcastiso_connection_info->master_bd_addr); clear_address(&pinfo->dl_dst); diff --git a/epan/dissectors/packet-btmesh.c b/epan/dissectors/packet-btmesh.c index 6c325f0262..4eac4d0206 100644 --- a/epan/dissectors/packet-btmesh.c +++ b/epan/dissectors/packet-btmesh.c @@ -3637,7 +3637,7 @@ static void format_publish_period(gchar *buf, guint32 value) { guint32 idx = (value & 0xC0 ) >> 6; guint32 val = (value & 0x3F ) * period_interval_multiplier[idx]; - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u %s", val, period_interval_unit[idx]); + snprintf(buf, ITEM_LABEL_LENGTH, "%u %s", val, period_interval_unit[idx]); } static void @@ -3646,11 +3646,11 @@ format_transmit(gchar *buf, guint32 value) { guint32 ctr = (value & 0x07 ); switch (ctr) { case 0: - g_snprintf(buf, ITEM_LABEL_LENGTH, "One transmissions"); + snprintf(buf, ITEM_LABEL_LENGTH, "One transmissions"); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u transmissions at interval of %u ms", ctr, prd); + snprintf(buf, ITEM_LABEL_LENGTH, "%u transmissions at interval of %u ms", ctr, prd); } } @@ -3660,179 +3660,179 @@ format_retransmit(gchar *buf, guint32 value) { guint32 ctr = (value & 0x07 ); switch (ctr) { case 0: - g_snprintf(buf, ITEM_LABEL_LENGTH, "No retransmissions"); + snprintf(buf, ITEM_LABEL_LENGTH, "No retransmissions"); break; case 1: - g_snprintf(buf, ITEM_LABEL_LENGTH, "One retransmission after %u ms", prd); + snprintf(buf, ITEM_LABEL_LENGTH, "One retransmission after %u ms", prd); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u retransmissions at interval of %u ms", ctr, prd); + snprintf(buf, ITEM_LABEL_LENGTH, "%u retransmissions at interval of %u ms", ctr, prd); } } static void format_interval_steps(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms (%u)", (value + 1) * 10, value); + snprintf(buf, ITEM_LABEL_LENGTH, "%u ms (%u)", (value + 1) * 10, value); } static void format_key_index(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x)", value & 0xFFF, value & 0xFFF); + snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x)", value & 0xFFF, value & 0xFFF); } static void format_key_index_rfu(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "0x%1x", (value & 0xF000) >> 12); + snprintf(buf, ITEM_LABEL_LENGTH, "0x%1x", (value & 0xF000) >> 12); } static void format_dual_key_index(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x), %u (0x%03x)", value & 0xFFF, value & 0xFFF, ( value & 0xFFF000 ) >> 12, ( value & 0xFFF000 ) >> 12); + snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x), %u (0x%03x)", value & 0xFFF, value & 0xFFF, ( value & 0xFFF000 ) >> 12, ( value & 0xFFF000 ) >> 12); } static void format_vendor_model(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "0x%04x of %s", value >> 16, val_to_str_ext_const(value & 0xFFFF, &bluetooth_company_id_vals_ext, "Unknown")); + snprintf(buf, ITEM_LABEL_LENGTH, "0x%04x of %s", value >> 16, val_to_str_ext_const(value & 0xFFFF, &bluetooth_company_id_vals_ext, "Unknown")); } static void format_publish_appkeyindex_model(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x) using %s security material", value & 0x0FFF, value & 0x0FFF, ((value & 0x1000) ? "Friendship" : "Master")); + snprintf(buf, ITEM_LABEL_LENGTH, "%u (0x%03x) using %s security material", value & 0x0FFF, value & 0x0FFF, ((value & 0x1000) ? "Friendship" : "Master")); } static void format_delay_ms(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 5); + snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 5); } static void format_power(gchar *buf, guint32 value) { gdouble val; val = (gdouble)value / (gdouble)655.35; - g_snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val); + snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val); } static void format_battery_level(gchar *buf, guint32 value) { if (value == 0xFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "The percentage of the charge level is unknown"); + snprintf(buf, ITEM_LABEL_LENGTH, "The percentage of the charge level is unknown"); return; } if (value <= 0x64) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u %%", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%u %%", value); return; } - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%u)", value); } static void format_battery_time(gchar *buf, guint32 value) { if (value == 0xFFFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "The remaining time is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "The remaining time is not known"); return; } - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u minutes", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%u minutes", value); } static void format_global_latitude(gchar *buf, gint32 value) { if (value == INT_MIN) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Latitude is not configured."); + snprintf(buf, ITEM_LABEL_LENGTH, "Global Latitude is not configured."); return; } gdouble val; val = (gdouble)90.0 / (gdouble) (0x7FFFFFFF) * (gdouble)value ; - g_snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val); + snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val); } static void format_global_longitude(gchar *buf, gint32 value) { if (value == INT_MIN) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Longitude is not configured."); + snprintf(buf, ITEM_LABEL_LENGTH, "Global Longitude is not configured."); return; } gdouble val; val = (gdouble)180.0 / (gdouble) (0x7FFFFFFF) * (gdouble)value; - g_snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val); + snprintf(buf, ITEM_LABEL_LENGTH, "% 2.6f°", val); } static void format_global_altitude(gchar *buf, gint16 value) { if (value == 0x7FFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is not configured."); + snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is not configured."); return; } if (value == 0x7FFE) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is greater than or equal to 32766 meters."); + snprintf(buf, ITEM_LABEL_LENGTH, "Global Altitude is greater than or equal to 32766 meters."); return; } - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d meters", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d meters", value); } static void format_local_north(gchar *buf, gint16 value) { if (value == -32768) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Local North information is not configured."); + snprintf(buf, ITEM_LABEL_LENGTH, "Local North information is not configured."); return; } gdouble val; val = (gdouble)value / (gdouble) 10.0; - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val); } static void format_local_east(gchar *buf, gint16 value) { if (value == -32768) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Local East information is not configured."); + snprintf(buf, ITEM_LABEL_LENGTH, "Local East information is not configured."); return; } gdouble val; val = (gdouble)value / (gdouble) 10.0; - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val); } static void format_local_altitude(gchar *buf, gint16 value) { if (value == 0x7FFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is not configured."); + snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is not configured."); return; } if (value == 0x7FFE) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is greater than or equal to 3276.6 meters."); + snprintf(buf, ITEM_LABEL_LENGTH, "Local Altitude is greater than or equal to 3276.6 meters."); return; } gdouble val; val = (gdouble)value / (gdouble) 10.0; - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f meters", val); } static void format_floor_number(gchar *buf, guint8 value) { switch (value) { case 0x00: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Floor -20 or any floor below -20."); + snprintf(buf, ITEM_LABEL_LENGTH, "Floor -20 or any floor below -20."); break; case 0xFC: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Floor 232 or any floor above 232."); + snprintf(buf, ITEM_LABEL_LENGTH, "Floor 232 or any floor above 232."); break; case 0xFD: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 0."); + snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 0."); break; case 0xFE: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 1."); + snprintf(buf, ITEM_LABEL_LENGTH, "Ground floor. Floor 1."); break; case 0xFF: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Not configured."); + snprintf(buf, ITEM_LABEL_LENGTH, "Not configured."); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", (gint16)value - (gint16)20 ); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", (gint16)value - (gint16)20 ); break; } } @@ -3841,46 +3841,46 @@ static void format_update_time(gchar *buf, guint16 value) { gdouble val; val = pow((gdouble)2.0, (gdouble)(value - 3)); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.*f seconds", (value<4?3-value:0), val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.*f seconds", (value<4?3-value:0), val); } static void format_precision(gchar *buf, guint16 value) { gdouble val; val = pow((gdouble)2.0, (gdouble)(value - 3)); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.*f meters", (value<4?3-value:0),val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.*f meters", (value<4?3-value:0),val); } static void format_scheduler_year(gchar *buf, gint32 value) { if (value <= 0x63) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", 2000+value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", 2000+value); } else if (value == 0x64 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Any year"); + snprintf(buf, ITEM_LABEL_LENGTH, "Any year"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } } static void format_scheduler_day(gchar *buf, gint32 value) { if (value > 0x0) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Any day"); + snprintf(buf, ITEM_LABEL_LENGTH, "Any day"); } } static void format_scheduler_hour(gchar *buf, gint32 value) { if (value < 24 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); } else if (value == 0x18 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Any hour of the day"); + snprintf(buf, ITEM_LABEL_LENGTH, "Any hour of the day"); } else if (value == 0x19 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Once a day (at a random hour)"); + snprintf(buf, ITEM_LABEL_LENGTH, "Once a day (at a random hour)"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } } @@ -3888,23 +3888,23 @@ static void format_scheduler_minute(gchar *buf, gint32 value) { switch (value) { case 0x3C: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Any minute of the hour"); + snprintf(buf, ITEM_LABEL_LENGTH, "Any minute of the hour"); break; case 0x3D: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 minutes (minute modulo 15 is 0) (0, 15, 30, 45)"); + snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 minutes (minute modulo 15 is 0) (0, 15, 30, 45)"); break; case 0x3E: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 minutes (minute modulo 20 is 0) (0, 20, 40)"); + snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 minutes (minute modulo 20 is 0) (0, 20, 40)"); break; case 0x3F: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Once an hour (at a random minute)"); + snprintf(buf, ITEM_LABEL_LENGTH, "Once an hour (at a random minute)"); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); break; } } @@ -3913,23 +3913,23 @@ static void format_scheduler_second(gchar *buf, gint32 value) { switch (value) { case 0x3C: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Any second of the minute"); + snprintf(buf, ITEM_LABEL_LENGTH, "Any second of the minute"); break; case 0x3D: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 seconds (second modulo 15 is 0) (0, 15, 30, 45)"); + snprintf(buf, ITEM_LABEL_LENGTH, "Every 15 seconds (second modulo 15 is 0) (0, 15, 30, 45)"); break; case 0x3E: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 seconds (second modulo 20 is 0) (0, 20, 40)"); + snprintf(buf, ITEM_LABEL_LENGTH, "Every 20 seconds (second modulo 20 is 0) (0, 20, 40)"); break; case 0x3F: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Once a minute (at a random second)"); + snprintf(buf, ITEM_LABEL_LENGTH, "Once a minute (at a random second)"); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); break; } } @@ -3938,23 +3938,23 @@ static void format_scheduler_action(gchar *buf, gint32 value) { switch (value) { case 0x0: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Turn Off"); + snprintf(buf, ITEM_LABEL_LENGTH, "Turn Off"); break; case 0x1: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Turn On"); + snprintf(buf, ITEM_LABEL_LENGTH, "Turn On"); break; case 0x2: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Scene Recall"); + snprintf(buf, ITEM_LABEL_LENGTH, "Scene Recall"); break; case 0xF: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Inactive"); + snprintf(buf, ITEM_LABEL_LENGTH, "Inactive"); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Reserved for Future Use"); + snprintf(buf, ITEM_LABEL_LENGTH, "Reserved for Future Use"); break; } } @@ -4008,28 +4008,28 @@ format_scheduler_day_of_week(gchar *buf, gint32 value) { static void format_subsecond_ms(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f ms", (gdouble)value / 0.256); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f ms", (gdouble)value / 0.256); } static void format_uncertainty_ms(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 10); + snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 10); } static void format_tai_utc_delta_s(gchar *buf, guint32 value) { gint32 val = (gint32)value - 255; - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d s", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%d s", val); } static void format_time_zone_offset_h(gchar *buf, guint32 value) { gint32 val = (gint32)value - 64; if (val >= 0) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%+d:%02d", val/4, (val%4)*15 ); + snprintf(buf, ITEM_LABEL_LENGTH, "%+d:%02d", val/4, (val%4)*15 ); } else { val *=-1; - g_snprintf(buf, ITEM_LABEL_LENGTH, "-%d:%02d", val/4, (val%4)*15 ); + snprintf(buf, ITEM_LABEL_LENGTH, "-%d:%02d", val/4, (val%4)*15 ); } } @@ -4037,7 +4037,7 @@ static void format_tai_to_utc_date(gchar *buf, guint64 value) { if (value == 0 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Unknown"); + snprintf(buf, ITEM_LABEL_LENGTH, "Unknown"); } else { gchar *time_str; time_t val; @@ -4063,49 +4063,49 @@ format_tai_to_utc_date(gchar *buf, guint64 value) { // 32 leap seconds difference between TAI and UTC on 1.1.2000 val = (time_t)(value + 946684800ll - 32ll - delta); time_str = abs_time_secs_to_str(NULL, val, ABSOLUTE_TIME_UTC, TRUE); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%s", time_str); + snprintf(buf, ITEM_LABEL_LENGTH, "%s", time_str); } } static void format_temperature_kelvin(gchar *buf, guint32 value) { if (value < 0x0320 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); } else if (value > 0x4E20 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value); } } static void format_temperature_kelvin_unknown(gchar *buf, guint32 value) { if (value < 0x0320 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); } else if (value > 0x4E20 && value != 0xFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); } else if (value == 0xFFFF ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Unknown"); + snprintf(buf, ITEM_LABEL_LENGTH, "Unknown"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d K", value); } } static void format_light_lightness_prohibited(gchar *buf, guint32 value) { if (value == 0x0 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); } } static void format_light_lightness_default(gchar *buf, guint32 value) { if (value == 0x0 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Use the Light Lightness Last value"); + snprintf(buf, ITEM_LABEL_LENGTH, "Use the Light Lightness Last value"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); } } @@ -4113,25 +4113,25 @@ static void format_hsl_hue(gchar *buf, guint32 value) { gdouble val; val = (gdouble)360.0 / (gdouble) (0x10000) * (gdouble)value; - g_snprintf(buf, ITEM_LABEL_LENGTH, "% 3.3f°", val); + snprintf(buf, ITEM_LABEL_LENGTH, "% 3.3f°", val); } static void format_xyl_coordinate(gchar *buf, guint32 value) { gdouble val; val = (gdouble)value / (gdouble) (0xFFFF); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%1.5f", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%1.5f", val); } static void format_sensor_setting_access(gchar *buf, guint32 value) { if (value == 0x01 ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); } else if (value == 0x03) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } } @@ -4139,10 +4139,10 @@ static void format_fast_cadence_period_divisor(gchar *buf, guint32 value) { if (value > 15) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } else { guint32 v = (1 << value); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", v); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", v); } } @@ -4150,10 +4150,10 @@ static void format_status_min_interval(gchar *buf, guint32 value) { if (value > 26) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } else { guint32 v = (1 << value); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d ms", v); + snprintf(buf, ITEM_LABEL_LENGTH, "%d ms", v); } } @@ -4162,23 +4162,23 @@ format_admin_user_access(gchar *buf, guint32 value) { switch (value) { case 0x0: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property"); + snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property"); break; case 0x1: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); break; case 0x2: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be written"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be written"); break; case 0x3: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written"); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); break; } } @@ -4187,11 +4187,11 @@ static void format_manufacturer_user_access(gchar *buf, guint32 value) { if (value == 0x00) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property"); + snprintf(buf, ITEM_LABEL_LENGTH, "Not a Generic User Property"); } else if (value == 0x01) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } } @@ -4200,19 +4200,19 @@ format_user_access(gchar *buf, guint32 value) { switch (value) { case 0x1: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be read"); break; case 0x2: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be written"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be written"); break; case 0x3: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written"); + snprintf(buf, ITEM_LABEL_LENGTH, "Can be read and written"); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); break; } } @@ -4221,11 +4221,11 @@ static void format_sensor_descriptor_tolerance(gchar *buf, guint32 value) { if (value == 0x000) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Unspecified"); + snprintf(buf, ITEM_LABEL_LENGTH, "Unspecified"); } else { gdouble val; val = (gdouble)value / (gdouble)40.95; - g_snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val); + snprintf(buf, ITEM_LABEL_LENGTH, "% 3.2f %%", val); } } @@ -4233,22 +4233,22 @@ static void format_sensor_period(gchar *buf, guint32 value) { if (value == 0) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Not Applicable"); + snprintf(buf, ITEM_LABEL_LENGTH, "Not Applicable"); } else { gdouble val; val = pow((gdouble)1.1, (gdouble)value - (gdouble)64.0); if ( val < 1.0 ) { //Milliseconds - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.0f ms", val * 1000.0); + snprintf(buf, ITEM_LABEL_LENGTH, "%.0f ms", val * 1000.0); } else { if ( val < 60.0 ) { //Seconds - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f s", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f s", val); } else { gulong v = (gulong)val; if ( val < 86400 ) { //Hours:Minutes:Seconds - g_snprintf(buf, ITEM_LABEL_LENGTH, "%02lu:%02lu:%02lu", v/3600, (v % 3600)/60, v % 60); + snprintf(buf, ITEM_LABEL_LENGTH, "%02lu:%02lu:%02lu", v/3600, (v % 3600)/60, v % 60); } else { //Days Hours:Minutes:Seconds - g_snprintf(buf, ITEM_LABEL_LENGTH, "%lu days %02lu:%02lu:%02lu", v/86400, (v % 86400)/3600, (v % 3600)/60, v % 60); + snprintf(buf, ITEM_LABEL_LENGTH, "%lu days %02lu:%02lu:%02lu", v/86400, (v % 86400)/3600, (v % 3600)/60, v % 60); } } } @@ -4260,21 +4260,21 @@ format_percentage_change_16(gchar *buf, guint32 value) { gdouble val; val = (gdouble)value / (gdouble)(100); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f %%", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.2f %%", val); } static void format_decihour_8(gchar *buf, guint32 value) { if (value == 0xFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { if (value > 240) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } else { gdouble val; val = (gdouble)value / (gdouble)(10); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f h", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f h", val); } } } @@ -4283,11 +4283,11 @@ static void format_temperature_8(gchar *buf, gint32 value) { if (value == 0x7F) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { gdouble val; val = (gdouble)value * (gdouble)(0.5); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f C", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f C", val); } } @@ -4295,14 +4295,14 @@ static void format_temperature(gchar *buf, gint32 value) { if (value == INT16_MIN ) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { if (value < (gint32)(-27315)) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited"); } else { gdouble val; val = (gdouble)value / (gdouble)(100); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f C", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.2f C", val); } } } @@ -4311,11 +4311,11 @@ static void format_electric_current(gchar *buf, guint32 value) { if (value == 0xFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { gdouble val; val = (gdouble)value / (gdouble)(100); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f A", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.2f A", val); } } @@ -4323,73 +4323,73 @@ static void format_energy(gchar *buf, guint32 value) { if (value == 0xFFFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d kWh", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d kWh", value); } } static void format_illuminance(gchar *buf, guint32 value) { if (value == 0xFFFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { gdouble val; val = (gdouble)value / (gdouble)(100); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f lux", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.2f lux", val); } } static void format_percentage_8(gchar *buf, guint32 value) { if (value == 0xFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else if (value > 200) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); } else { gdouble val; val = (gdouble)value / (gdouble)(2); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.1f %%", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.1f %%", val); } } static void format_time_millisecond_24(gchar *buf, guint32 value) { if (value == 0xFFFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { gdouble val; val = (gdouble)value / (gdouble)(1000); - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f s", val); + snprintf(buf, ITEM_LABEL_LENGTH, "%.2f s", val); } } static void format_count_16(gchar *buf, guint32 value) { if (value == 0xFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d", value); } } static void format_boolean(gchar *buf, guint32 value) { if (value == 0x00) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "False"); + snprintf(buf, ITEM_LABEL_LENGTH, "False"); } else if (value == 0x01) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "True"); + snprintf(buf, ITEM_LABEL_LENGTH, "True"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Prohibited (%d)", value); } } static void format_time_second_16(gchar *buf, guint32 value) { if (value == 0xFFFF) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); + snprintf(buf, ITEM_LABEL_LENGTH, "Value is not known"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%d s", value); + snprintf(buf, ITEM_LABEL_LENGTH, "%d s", value); } } diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c index 1dd326872c..0a3faca9df 100644 --- a/epan/dissectors/packet-btrfcomm.c +++ b/epan/dissectors/packet-btrfcomm.c @@ -260,9 +260,9 @@ static void btrfcomm_directed_channel_prompt(packet_info *pinfo, gchar* result) value_data = (guint8 *) p_get_proto_data(pinfo->pool, pinfo, proto_btrfcomm, PROTO_DATA_BTRFCOMM_DIRECTED_CHANNEL); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RFCOMM Channel %d (direction: %u) as", (guint) (*value_data) >> 1, (guint) (*value_data) & 1); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RFCOMM Channel %d (direction: %u) as", (guint) (*value_data) >> 1, (guint) (*value_data) & 1); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown RFCOMM Channel"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown RFCOMM Channel"); } static gpointer btrfcomm_directed_channel_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c index a60b3051b4..14c731687d 100644 --- a/epan/dissectors/packet-btsdp.c +++ b/epan/dissectors/packet-btsdp.c @@ -3071,7 +3071,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, proto_tree_add_item(next_tree, hf_bip_total_imaging_data_capacity, tvb, offset, 8, ENC_BIG_ENDIAN); value_64 = tvb_get_ntoh64(tvb, offset); - wmem_strbuf_append_printf(info_buf, "%"G_GUINT64_FORMAT, value_64); + wmem_strbuf_append_printf(info_buf, "%"PRIu64, value_64); break; default: found = FALSE; diff --git a/epan/dissectors/packet-bvlc.c b/epan/dissectors/packet-bvlc.c index eaaa954c68..3a4c1699dc 100644 --- a/epan/dissectors/packet-bvlc.c +++ b/epan/dissectors/packet-bvlc.c @@ -992,7 +992,7 @@ dissect_bscvlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ if ((bvlc_control & BSCVLC_CONTROL_ORIG_ADDRESS) != 0) { for(idx = 0; idx < 6; idx++) - g_snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx)); + snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx)); col_append_fstr(pinfo->cinfo, COL_INFO, " SMAC %s", mac_buffer); proto_tree_add_item(bvlc_tree, hf_bscvlc_orig_vmac, tvb, offset, 6, ENC_NA); @@ -1002,7 +1002,7 @@ dissect_bscvlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ if ((bvlc_control & BSCVLC_CONTROL_DEST_ADDRESS) != 0) { for(idx = 0; idx < 6; idx++) - g_snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx)); + snprintf(&mac_buffer[idx * 2], sizeof(mac_buffer) - (idx * 2), "%02X", tvb_get_guint8(tvb, offset + idx)); col_append_fstr(pinfo->cinfo, COL_INFO, " DMAC %s", mac_buffer); proto_tree_add_item(bvlc_tree, hf_bscvlc_dest_vmac, tvb, offset, 6, ENC_NA); diff --git a/epan/dissectors/packet-c15ch.c b/epan/dissectors/packet-c15ch.c index 7ca2c7a8ff..8467fa3ccd 100644 --- a/epan/dissectors/packet-c15ch.c +++ b/epan/dissectors/packet-c15ch.c @@ -4579,7 +4579,7 @@ static int dissect_c15ch_echo_cancel(tvbuff_t *tvb, packet_info *pinfo _U_, prot loop_val = tvb_get_ntohl( tvb, 23 ); slot_val = tvb_get_ntohl( tvb, 27 ); loc_string = (char *) wmem_alloc0(wmem_packet_scope(), MAX_LEN_LOC_STRING); /* init to all NULL */ - g_snprintf( loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", pm_val, pc_val, loop_val, slot_val ); + snprintf( loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", pm_val, pc_val, loop_val, slot_val ); ti = proto_tree_add_string(c15ch_echo_cancel_tree, hf_c15ch_echo_cancel_location, tvb, 15, (27 + 4 - 15) + 1, loc_string); loc_tree = proto_item_add_subtree (ti, ett_c15ch_second_level_sub4); @@ -4777,55 +4777,55 @@ static int dissect_c15ch_nitnxlate(tvbuff_t *tvb, packet_info *pinfo, proto_tree if ( ( site_str_len > 1 ) && ( subsite_str_len > 1 ) && ( equipname_str_len > 1 ) ) { /* 1) none of site, subsite, or equip is null */ - g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s %s ", site_string, subsite_string, equipname_string ); + snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s %s ", site_string, subsite_string, equipname_string ); } else if ( ( site_str_len < 2 ) && ( subsite_str_len > 1 ) && ( equipname_str_len > 1 ) ) { /* 2) only site is null */ - g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", subsite_string, equipname_string ); + snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", subsite_string, equipname_string ); } else if ( ( site_str_len > 1 ) && ( subsite_str_len < 2 ) && ( equipname_str_len > 1 ) ) { /* 3) only subsite is null */ - g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, equipname_string); + snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, equipname_string); } else if ( ( site_str_len > 1 ) && ( subsite_str_len > 1 ) && ( equipname_str_len < 2 ) ) { /* 4) only equip is null */ - g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, subsite_string); + snprintf( desc_string, MAX_LEN_DESC_STRING, "%s %s ", site_string, subsite_string); } else if ( ( site_str_len < 2 ) && ( subsite_str_len < 2 ) && ( equipname_str_len > 1 ) ) { /* 5) site and subsite are null but equip is non-null */ - g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", equipname_string ); + snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", equipname_string ); } else if ( ( site_str_len < 2 ) && ( subsite_str_len > 1 ) && ( equipname_str_len < 2 ) ) { /* 6) site and equip are null but subsite is not-null */ - g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", subsite_string ); + snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", subsite_string ); } else if ( ( site_str_len > 1 ) && ( subsite_str_len < 2 ) && ( equipname_str_len < 2 ) ) { /* 7) subsite and equip are null but site is not-null */ - g_snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", site_string ); + snprintf( desc_string, MAX_LEN_DESC_STRING, "%s ", site_string ); } /* else site, subsite, equip are all null */ if ( key_val ) { if ( strlen( desc_string ) ) { - g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d %d", + snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d %d", desc_string, frame_val, shelf_val, lsg_val, unit_val, key_val ); } else { - g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d %d", + snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d %d", frame_val, shelf_val, lsg_val, unit_val, key_val ); } } @@ -4836,23 +4836,23 @@ static int dissect_c15ch_nitnxlate(tvbuff_t *tvb, packet_info *pinfo, proto_tree if ( (g_strcmp0( "VLIN", equipname_string) == 0) || (g_strcmp0( "PTRK", equipname_string) == 0) ) { - g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d", + snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d", desc_string, frame_val ); } else if ( (g_strcmp0( "GWE", equipname_string ) == 0) || (g_strcmp0( "IDE", equipname_string ) == 0) ) { - g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d", + snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d", desc_string, frame_val, shelf_val ); } else - g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d", + snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%s%d %d %d %d", desc_string, frame_val, shelf_val, lsg_val, unit_val); } /* if ( strlen( desc_string ) ) */ else { - g_snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d", + snprintf( concat_string, MAX_LEN_CONCAT_STRING, "%d %d %d %d", frame_val, shelf_val, lsg_val, unit_val); } } @@ -5055,7 +5055,7 @@ static int dissect_c15ch_ntwk_conn(tvbuff_t *tvb, packet_info *pinfo, proto_tree from_loop_val = tvb_get_guint8( tvb, 10 ); from_slot_val = tvb_get_guint8( tvb, 11 ); from_loc_string = (char *) wmem_alloc0(wmem_packet_scope(), MAX_LEN_LOC_STRING); /* init to all NULL */ - g_snprintf( from_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", from_pm_val, from_pc_val, from_loop_val, from_slot_val ); + snprintf( from_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", from_pm_val, from_pc_val, from_loop_val, from_slot_val ); ti = proto_tree_add_string(c15ch_ntwk_conn_tree, hf_c15ch_ntwk_conn_fromlocation, tvb, 8, (11 - 8) + 1, from_loc_string); old_loc_tree = proto_item_add_subtree (ti, ett_c15ch_second_level_sub1); @@ -5096,7 +5096,7 @@ static int dissect_c15ch_ntwk_conn(tvbuff_t *tvb, packet_info *pinfo, proto_tree to_loop_val = tvb_get_guint8( tvb, 33 ); to_slot_val = tvb_get_guint8( tvb, 34 ); to_loc_string = (char *) wmem_alloc0(wmem_packet_scope(), MAX_LEN_LOC_STRING); /* init to all NULL */ - g_snprintf( to_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", to_pm_val, to_pc_val, to_loop_val, to_slot_val ); + snprintf( to_loc_string, MAX_LEN_LOC_STRING, "%d %d %d %d", to_pm_val, to_pc_val, to_loop_val, to_slot_val ); ti = proto_tree_add_string(c15ch_ntwk_conn_tree, hf_c15ch_ntwk_conn_tolocation, tvb, 31, (34 - 31) + 1, to_loc_string); new_loc_tree = proto_item_add_subtree (ti, ett_c15ch_second_level_sub3); diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c index 7d5a19227e..5989158fc2 100644 --- a/epan/dissectors/packet-catapult-dct2000.c +++ b/epan/dissectors/packet-catapult-dct2000.c @@ -2101,11 +2101,11 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre int hex_string_length = 1+(2*tty_string_length)+1; hex_string = (char *)wmem_alloc(pinfo->pool, hex_string_length); - idx = g_snprintf(hex_string, hex_string_length, "$"); + idx = snprintf(hex_string, hex_string_length, "$"); /* Write hex out to new string */ for (n=0; n < tty_string_length; n++) { - idx += g_snprintf(hex_string+idx, 3, "%02x", + idx += snprintf(hex_string+idx, 3, "%02x", tvb_get_guint8(tvb, offset+n)); } string = hex_string; @@ -3181,7 +3181,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo if (protocol_handle == 0) { /* TODO: only look inside if a preference enabled? */ char dotted_protocol_name[128]; - /* N.B. avoiding g_snprintf(), which was slow */ + /* N.B. avoiding snprintf(), which was slow */ (void) g_strlcpy(dotted_protocol_name, "dct2000.", 128); (void) g_strlcpy(dotted_protocol_name+8, protocol_name, 128-8); protocol_handle = find_dissector(dotted_protocol_name); diff --git a/epan/dissectors/packet-cbor.c b/epan/dissectors/packet-cbor.c index 5ca3a4d6d0..dadd84af6a 100644 --- a/epan/dissectors/packet-cbor.c +++ b/epan/dissectors/packet-cbor.c @@ -306,7 +306,7 @@ dissect_cbor_byte_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tre } if (length > G_MAXINT32 || *offset + (gint)length < *offset) { expert_add_info_format(pinfo, cbor_tree, &ei_cbor_too_long_length, - "the length (%" G_GUINT64_FORMAT ") of the byte string too long", length); + "the length (%" PRIu64 ") of the byte string too long", length); return NULL; } item = proto_tree_add_item(cbor_tree, hf_cbor_type_byte_string, tvb, *offset, (gint)length, ENC_BIG_ENDIAN|ENC_NA); @@ -381,7 +381,7 @@ dissect_cbor_text_string(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tre } if (length > G_MAXINT32 || *offset + (gint)length < *offset) { expert_add_info_format(pinfo, cbor_tree, &ei_cbor_too_long_length, - "the length (%" G_GUINT64_FORMAT ") of the text string too long", length); + "the length (%" PRIu64 ") of the text string too long", length); return NULL; } item = proto_tree_add_item(cbor_tree, hf_cbor_type_text_string, tvb, *offset, (gint)length, ENC_BIG_ENDIAN|ENC_UTF_8); @@ -442,7 +442,7 @@ dissect_cbor_array(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tree, gin tvb, orig_offset, -1, "Array", "(undefined elements)"); } else { item = proto_tree_add_string_format_value(cbor_tree, hf_cbor_type_array, - tvb, orig_offset, -1, "Array", "(%"G_GINT64_MODIFIER"u elements)", length); + tvb, orig_offset, -1, "Array", "(%"PRIu64" elements)", length); } subtree = proto_item_add_subtree(item, ett_cbor_array); @@ -518,7 +518,7 @@ dissect_cbor_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *cbor_tree, gint tvb, orig_offset, -1, "Map", "(undefined entries)"); } else { item = proto_tree_add_string_format_value(cbor_tree, hf_cbor_type_map, - tvb, orig_offset, -1, "Map", "(%"G_GINT64_MODIFIER"u entries)", length); + tvb, orig_offset, -1, "Map", "(%"PRIu64" entries)", length); } subtree = proto_item_add_subtree(item, ett_cbor_map); diff --git a/epan/dissectors/packet-cemi.c b/epan/dissectors/packet-cemi.c index c3741b8fea..0ac82c0ac2 100644 --- a/epan/dissectors/packet-cemi.c +++ b/epan/dissectors/packet-cemi.c @@ -1088,7 +1088,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g gchar* output = info->output_text; gint output_max = sizeof info->output_text; - g_snprintf( output, output_max, "with " ); + snprintf( output, output_max, "with " ); while( *output ) { ++output; --output_max; } // Try keys from keyring.XML @@ -1107,7 +1107,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g if( decrypted ) { - g_snprintf( output, output_max, "GA " ); + snprintf( output, output_max, "GA " ); while( *output ) { ++output; --output_max; } break; } @@ -1129,7 +1129,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g if( decrypted ) { - g_snprintf( output, output_max, "dest IA " ); + snprintf( output, output_max, "dest IA " ); while( *output ) { ++output; --output_max; } break; } @@ -1152,7 +1152,7 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g if( decrypted ) { - g_snprintf( output, output_max, "source IA " ); + snprintf( output, output_max, "source IA " ); while( *output ) { ++output; --output_max; } break; } @@ -1182,17 +1182,17 @@ static const guint8* decrypt_data_security_data( wmem_allocator_t *pool, const g { guint8 count; - g_snprintf( output, output_max, "key" ); + snprintf( output, output_max, "key" ); for( count = 16; count; --count ) { while( *output ) { ++output; --output_max; } - g_snprintf( output, output_max, " %02X", *key++ ); + snprintf( output, output_max, " %02X", *key++ ); } } else { - g_snprintf( info->output_text, sizeof info->output_text, keys_found ? "failed" : "no keys found" ); + snprintf( info->output_text, sizeof info->output_text, keys_found ? "failed" : "no keys found" ); } return decrypted; @@ -1712,8 +1712,8 @@ static void dissect_memory_ext_service( tvbuff_t* tvb, packet_info* pinfo, proto /* 3 bytes Memory Address */ guint32 x = tvb_get_guint24( tvb, offset + 1, ENC_BIG_ENDIAN ); - col_append_fstr( cinfo, COL_INFO, " X=$%06" G_GINT32_MODIFIER "X", x ); - proto_item_append_text( cemi_node, ", X=$%06" G_GINT32_MODIFIER "X", x ); + col_append_fstr( cinfo, COL_INFO, " X=$%06" PRIX32, x ); + proto_item_append_text( cemi_node, ", X=$%06" PRIX32, x ); if( is_response ) { @@ -2355,7 +2355,7 @@ static void dissect_data_security_service( tvbuff_t* tvb, packet_info* pinfo, pr { if( ia_seq->seq > seq_nr ) { - expert_add_info_format( pinfo, node, KIP_ERROR, "Expected: min $%012" G_GINT64_MODIFIER "X", ia_seq->seq ); + expert_add_info_format( pinfo, node, KIP_ERROR, "Expected: min $%012" PRIX64, ia_seq->seq ); break; } } @@ -2888,7 +2888,7 @@ static void dissect_cemi_transport_layer( tvbuff_t* tvb, packet_info* pinfo, pro name = try_val_to_str( tc, tc_vals ); if( !name ) { - g_snprintf( text, sizeof text, "TC=%u", tc ); + snprintf( text, sizeof text, "TC=%u", tc ); name = text; } col_append_fstr( cinfo, COL_INFO, " %s", name ); @@ -3192,7 +3192,7 @@ static void dissect_cemi_link_layer( tvbuff_t* tvb, packet_info* pinfo, proto_tr guint8 hc = (c & 0x70) >> 4; /* Hop Count */ guint8 eff = c & 0x0F; /* Extended Frame Format (0 = standard) */ - g_snprintf( text, sizeof text, "%u", (c & 0x70) >> 4 ); /* hop count */ + snprintf( text, sizeof text, "%u", (c & 0x70) >> 4 ); /* hop count */ proto_item_append_text( cemi_node, ", H=%u", hc ); node = proto_tree_add_none_format( cemi_list, hf_folder, tvb, offset, 1, "Ctrl2: Hops = %u", hc ); if( eff ) @@ -3220,7 +3220,7 @@ static void dissect_cemi_link_layer( tvbuff_t* tvb, packet_info* pinfo, proto_tr else { source_addr = tvb_get_ntohs( tvb, offset ); - g_snprintf( text, sizeof text, "%u.%u.%u", (source_addr >> 12) & 0xF, (source_addr >> 8) & 0xF, source_addr & 0xFF ); + snprintf( text, sizeof text, "%u.%u.%u", (source_addr >> 12) & 0xF, (source_addr >> 8) & 0xF, source_addr & 0xFF ); col_append_fstr( cinfo, COL_INFO, " %s", text ); if( tree ) { @@ -3247,12 +3247,12 @@ static void dissect_cemi_link_layer( tvbuff_t* tvb, packet_info* pinfo, proto_tr if( unicast ) { /* Individual Address */ - g_snprintf( text, sizeof text, "%u.%u.%u", (dest_addr >> 12) & 0xF, (dest_addr >> 8) & 0xF, dest_addr & 0xFF ); + snprintf( text, sizeof text, "%u.%u.%u", (dest_addr >> 12) & 0xF, (dest_addr >> 8) & 0xF, dest_addr & 0xFF ); } else { /* Group Address */ - g_snprintf( text, sizeof text, "%u/%u/%u", (dest_addr >> 11) & 0x1F, (dest_addr >> 8) & 0x7, dest_addr & 0xFF ); + snprintf( text, sizeof text, "%u/%u/%u", (dest_addr >> 11) & 0x1F, (dest_addr >> 8) & 0x7, dest_addr & 0xFF ); } col_append_fstr( cinfo, COL_INFO, "->%s", text ); diff --git a/epan/dissectors/packet-ceph.c b/epan/dissectors/packet-ceph.c index 6aa0b73626..009a5af44f 100644 --- a/epan/dissectors/packet-ceph.c +++ b/epan/dissectors/packet-ceph.c @@ -1617,7 +1617,7 @@ void c_append_text(c_pkt_data *data, proto_item *ti, const char *fmt, ...) char buf[ITEM_LABEL_LENGTH]; va_start(ap, fmt); - g_vsnprintf(buf, sizeof(buf), fmt, ap); + vsnprintf(buf, sizeof(buf), fmt, ap); proto_item_append_text(ti, "%s", buf); proto_item_append_text(data->item_root, "%s", buf); @@ -1787,7 +1787,7 @@ guint c_dissect_blob(proto_tree *root, int hf, int hf_data, int hf_len, ti = proto_tree_add_item(root, hf, tvb, off, size+4, ENC_NA); tree = proto_item_add_subtree(ti, ett_data); - proto_item_append_text(ti, ", Size: %"G_GINT32_MODIFIER"u", size); + proto_item_append_text(ti, ", Size: %"PRIu32, size); if (size) { proto_item_append_text(ti, ", Data: %s", @@ -1924,7 +1924,7 @@ guint c_dissect_sockaddr(proto_tree *root, c_sockaddr *out, } off += C_SIZE_SOCKADDR_STORAGE; /* Skip over sockaddr_storage. */ - d.str = wmem_strdup_printf(wmem_packet_scope(), "%s:%"G_GINT16_MODIFIER"u", + d.str = wmem_strdup_printf(wmem_packet_scope(), "%s:%"PRIu16, d.addr_str, d.port); proto_item_append_text(ti, ": %s", d.str); @@ -2015,7 +2015,7 @@ guint c_dissect_entityname(proto_tree *root, int hf, c_entityname *out, } else { - d.slug = wmem_strdup_printf(wmem_packet_scope(), "%s%"G_GINT64_MODIFIER"u", + d.slug = wmem_strdup_printf(wmem_packet_scope(), "%s%"PRIu64, d.type_str, d.id); } @@ -2330,8 +2330,8 @@ guint c_dissect_eversion(proto_tree *root, gint hf, off += 4; proto_item_append_text(ti, - ", Version: %"G_GINT64_MODIFIER"d" - ", Epoch: %"G_GINT32_MODIFIER"d", + ", Version: %"PRId64 + ", Epoch: %"PRId32, ver, epoch); proto_item_set_end(ti, tvb, off); @@ -2354,7 +2354,7 @@ guint c_dissect_object_locator(proto_tree *root, gint hf, off = c_dissect_encoded(tree, &enchdr, 3, 6, tvb, off, data); - proto_item_append_text(ti, ", Pool: %"G_GINT64_MODIFIER"d", + proto_item_append_text(ti, ", Pool: %"PRId64, tvb_get_letohi64(tvb, off)); proto_tree_add_item(tree, hf_pool, tvb, off, 8, ENC_LITTLE_ENDIAN); off += 8; @@ -2382,7 +2382,7 @@ guint c_dissect_object_locator(proto_tree *root, gint hf, if (hash >= 0) { proto_tree_add_item(tree, hf_hash, tvb, off, 8, ENC_LITTLE_ENDIAN); - proto_item_append_text(ti, ", Hash: %"G_GINT64_MODIFIER"d", hash); + proto_item_append_text(ti, ", Hash: %"PRId64, hash); } off += 8; } @@ -2420,19 +2420,19 @@ guint c_dissect_pg(proto_tree *root, gint hf, c_warn_ver(ti2, ver, 1, 1, data); off += 1; - proto_item_append_text(ti, ", Pool: %"G_GINT64_MODIFIER"d", + proto_item_append_text(ti, ", Pool: %"PRId64, tvb_get_letoh64(tvb, off)); proto_tree_add_item(tree, hf_pgid_pool, tvb, off, 8, ENC_LITTLE_ENDIAN); off += 8; - proto_item_append_text(ti, ", Seed: %08"G_GINT32_MODIFIER"X", + proto_item_append_text(ti, ", Seed: %08"PRIX32, tvb_get_letohl(tvb, off)); proto_tree_add_item(tree, hf_pgid_seed, tvb, off, 4, ENC_LITTLE_ENDIAN); off += 4; preferred = tvb_get_letohl(tvb, off); if (preferred >= 0) - proto_item_append_text(ti, ", Prefer: %"G_GINT32_MODIFIER"d", preferred); + proto_item_append_text(ti, ", Prefer: %"PRId32, preferred); proto_tree_add_item(tree, hf_pgid_preferred, tvb, off, 4, ENC_LITTLE_ENDIAN); off += 4; @@ -2501,7 +2501,7 @@ guint c_dissect_path(proto_tree *root, gint hf, off = c_dissect_str(tree, hf_path_rel, &rel, tvb, off); if (inode) - proto_item_append_text(ti, ", Inode: 0x%016"G_GINT64_MODIFIER"u", inode); + proto_item_append_text(ti, ", Inode: 0x%016"PRIu64, inode); if (rel.size) proto_item_append_text(ti, ", Rel: \"%s\"", rel.str); @@ -2558,7 +2558,7 @@ guint c_dissect_mds_release(proto_tree *root, gint hf, off = c_dissect_str(tree, hf_mds_release_dname, NULL, tvb, off); - proto_item_append_text(ti, ", Inode: 0x%016"G_GINT64_MODIFIER"u", inode); + proto_item_append_text(ti, ", Inode: 0x%016"PRIu64, inode); proto_item_set_end(ti, tvb, off); return off; @@ -2654,7 +2654,7 @@ guint c_dissect_snapinfo(proto_tree *root, off = c_dissect_str(tree, hf_snapinfo_name, &name, tvb, off); - proto_item_set_text(ti, ", ID: 0x%016"G_GINT64_MODIFIER"X" + proto_item_set_text(ti, ", ID: 0x%016"PRIX64 ", Name: %s, Date: %s", id, name.str, @@ -3025,12 +3025,12 @@ guint c_dissect_featureset(proto_tree *root, int hf, off = c_dissect_str(subtree, hf_featureset_name_name, &name, tvb, off); - proto_item_append_text(ti2, ", Value: %"G_GINT64_MODIFIER"u, Name: %s", + proto_item_append_text(ti2, ", Value: %"PRIu64", Name: %s", val, name.str); proto_item_set_end(ti2, tvb, off); } - proto_item_append_text(ti, ", Features: 0x%016"G_GINT64_MODIFIER"X", features); + proto_item_append_text(ti, ", Features: 0x%016"PRIX64, features); proto_item_set_end(ti, tvb, off); return off; } @@ -3112,8 +3112,8 @@ guint c_dissect_osd_superblock(proto_tree *root, tvb, off, 4, ENC_LITTLE_ENDIAN); off += 4; - proto_item_append_text(ti, ", Role: %"G_GINT32_MODIFIER"d, Weight: %lf" - ", Boot Epoch: %"G_GINT32_MODIFIER"d", + proto_item_append_text(ti, ", Role: %"PRId32", Weight: %lf" + ", Boot Epoch: %"PRId32, role, weight, epoch); if (enc.version >= 4) { @@ -3424,7 +3424,7 @@ guint c_dissect_osdmap(proto_tree *root, off = c_dissect_pgpool(pooltree, tvb, off, data); - proto_item_append_text(poolti, ", ID: 0x%016"G_GINT64_MODIFIER"X", id); + proto_item_append_text(poolti, ", ID: 0x%016"PRIX64, id); proto_item_set_end(poolti, tvb, off); } @@ -3450,7 +3450,7 @@ guint c_dissect_osdmap(proto_tree *root, off = c_dissect_str(nametree, hf_osdmap_poolname, &name, tvb, off); proto_item_append_text(nameti, - ", ID: 0x%016"G_GINT64_MODIFIER"X, Name: %s", + ", ID: 0x%016"PRIX64", Name: %s", id, name.str); proto_item_set_end(nameti, tvb, off); } @@ -3866,11 +3866,11 @@ guint c_dissect_osd_op(proto_tree *root, gint hf, c_osd_op *out, proto_tree_add_item(tree, hf_osd_op_extent_trunc_seq, tvb, off+24, 4, ENC_LITTLE_ENDIAN); - proto_item_append_text(ti, ", Offset: %"G_GINT64_MODIFIER"u" - ", Size: %"G_GINT64_MODIFIER"u", + proto_item_append_text(ti, ", Offset: %"PRIu64 + ", Size: %"PRIu64, offset, size); if (trunc_seq) - proto_item_append_text(ti, ", Truncate To: %"G_GINT64_MODIFIER"u", + proto_item_append_text(ti, ", Truncate To: %"PRIu64, trunc_size); break; default: @@ -3881,7 +3881,7 @@ guint c_dissect_osd_op(proto_tree *root, gint hf, c_osd_op *out, off += 28; d.payload_size = tvb_get_letohl(tvb, off); - proto_item_append_text(ti, ", Data Length: %"G_GINT32_MODIFIER"d", + proto_item_append_text(ti, ", Data Length: %"PRId32, d.payload_size); proto_tree_add_item(tree, hf_osd_op_payload_size, tvb, off, 4, ENC_LITTLE_ENDIAN); @@ -4444,7 +4444,7 @@ guint c_dissect_msg_mon_sub(proto_tree *root, c_append_text(data, ti, "%s%s", str.str, len? ",":""); - proto_item_append_text(subti, " What: %s, Starting: %"G_GUINT64_FORMAT, + proto_item_append_text(subti, " What: %s, Starting: %"PRIu64, str.str, tvb_get_letoh64(tvb, off)); @@ -4675,7 +4675,7 @@ guint c_dissect_msg_mon_getversion(proto_tree *root, off = c_dissect_str(tree, hf_msg_mon_getversion_what, &what, tvb, off); - c_append_text(data, ti, ", TID: %"G_GINT64_MODIFIER"u, What: %s", + c_append_text(data, ti, ", TID: %"PRIu64", What: %s", tid, what.str); return off; @@ -4719,9 +4719,9 @@ guint c_dissect_msg_mon_getversionreply(proto_tree *root, tvb, off, 8, ENC_LITTLE_ENDIAN); off += 8; - c_append_text(data, ti, ", TID: %"G_GINT64_MODIFIER"u" - ", Version: %"G_GINT64_MODIFIER"u" - ", Oldest Version: %"G_GINT64_MODIFIER"u", + c_append_text(data, ti, ", TID: %"PRIu64 + ", Version: %"PRIu64 + ", Oldest Version: %"PRIu64, tid, ver, veroldest); return off; @@ -4927,8 +4927,8 @@ guint c_dissect_msg_client_reqfwd(proto_tree *root, tvb, off, 1, ENC_LITTLE_ENDIAN); off += 1; - c_append_text(data, ti, ", To: mds%"G_GINT32_MODIFIER"u, Resend: %s, " - "Forwards: %"G_GINT32_MODIFIER"u", + c_append_text(data, ti, ", To: mds%"PRIu32", Resend: %s, " + "Forwards: %"PRIu32, to, resend? "True":"False", fwd); return off; @@ -5032,7 +5032,7 @@ guint c_dissect_msg_osd_map(proto_tree *root, off = c_dissect_osdmap_inc(subtree, tvb, off, data); - proto_item_append_text(ti2, ", For Epoch: %"G_GINT32_MODIFIER"u", epoch); + proto_item_append_text(ti2, ", For Epoch: %"PRIu32, epoch); proto_item_set_end(ti2, tvb, off); } @@ -5055,7 +5055,7 @@ guint c_dissect_msg_osd_map(proto_tree *root, off = c_dissect_osdmap(subtree, tvb, off, data); - proto_item_append_text(ti2, ", For Epoch: %"G_GINT32_MODIFIER"u", epoch); + proto_item_append_text(ti2, ", For Epoch: %"PRIu32, epoch); proto_item_set_end(ti2, tvb, off); } @@ -5118,7 +5118,7 @@ guint c_dissect_msg_osd_op(proto_tree *root, off = c_dissect_str(tree, hf_msg_osd_op_oid, &str, tvb, off); opslen = tvb_get_letohs(tvb, off); - c_append_text(data, ti, ", Operations: %"G_GINT32_MODIFIER"d", opslen); + c_append_text(data, ti, ", Operations: %"PRId32, opslen); ti2 = proto_tree_add_item(tree, hf_msg_osd_op_ops_len, tvb, off, 2, ENC_LITTLE_ENDIAN); off += 2; @@ -5329,7 +5329,7 @@ guint c_dissect_msg_poolopreply(proto_tree *root, hf_msg_poolopreply_data, hf_msg_poolopreply_data_size, tvb, off); - c_append_text(data, ti, ", Response Code: %"G_GINT32_MODIFIER"u", code); + c_append_text(data, ti, ", Response Code: %"PRIu32, code); return off; } @@ -5402,7 +5402,7 @@ guint c_dissect_msg_poolop(proto_tree *root, } c_append_text(data, ti, - ", Type: %s, Name: %s, Pool: %"G_GINT32_MODIFIER"d", + ", Type: %s, Name: %s, Pool: %"PRId32, c_poolop_type_string(type), name.str, pool); @@ -5782,11 +5782,11 @@ guint c_dissect_msg_mon_paxos(proto_tree *root, hf_msg_mon_paxos_val_data, hf_msg_mon_paxos_val_size, tvb, off); - proto_item_append_text(ti2, ", Version: %"G_GINT64_MODIFIER"u", ver); + proto_item_append_text(ti2, ", Version: %"PRIu64, ver); proto_item_set_end(ti2, tvb, off); } - c_append_text(data, ti, ", Op: %s, Proposal Number: %"G_GINT64_MODIFIER"u", + c_append_text(data, ti, ", Op: %s, Proposal Number: %"PRIu64, c_mon_paxos_op_string(op), pn); return off; @@ -6194,8 +6194,8 @@ guint c_dissect_msg_client_caps(proto_tree *root, tvb, front_len, middle_len, ENC_NA); proto_item_append_text(ti, ", Op: %s" - ", Inode: 0x%016"G_GINT64_MODIFIER"X" - ", Relam: 0x%"G_GINT64_MODIFIER"X", + ", Inode: 0x%016"PRIX64 + ", Relam: 0x%"PRIX64, c_cap_op_type_string(op), inode, relam); @@ -6222,7 +6222,7 @@ guint c_dissect_msg_client_caprel(proto_tree *root, tree = proto_item_add_subtree(ti, ett_msg_client_caprel); i = (c_cap_op_type)tvb_get_letohl(tvb, off); - proto_item_append_text(ti, ", Caps: %"G_GINT32_MODIFIER"u", i); + proto_item_append_text(ti, ", Caps: %"PRIu32, i); off += 4; while (i--) { @@ -6287,8 +6287,8 @@ guint c_dissect_msg_timecheck(proto_tree *root, tvb, off, 8, ENC_LITTLE_ENDIAN); off += 8; - c_append_text(data, ti, ", Operation: %s, Epoch: %"G_GINT64_MODIFIER"u" - ", Round: %"G_GINT64_MODIFIER"u", + c_append_text(data, ti, ", Operation: %s, Epoch: %"PRIu64 + ", Round: %"PRIu64, c_timecheck_op_string(op), epoch, round); @@ -6865,7 +6865,7 @@ guint c_dissect_pdu(proto_tree *root, break; case C_STATE_SEQ: c_set_type(data, "Sequence Number"); - proto_item_append_text(data->item_root, ", Seq: %"G_GINT64_MODIFIER"u", + proto_item_append_text(data->item_root, ", Seq: %"PRIu64, tvb_get_letoh64(tvb, off)); proto_tree_add_item(tree, hf_seq_new, tvb, off, 8, ENC_LITTLE_ENDIAN); off += 8; diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c index 08651f7d18..f1b7494c34 100644 --- a/epan/dissectors/packet-cip.c +++ b/epan/dissectors/packet-cip.c @@ -2951,7 +2951,7 @@ static const value_string cip_run_idle_vals[] = { void cip_rpi_api_fmt(gchar *s, guint32 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.3fms", value / 1000.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.3fms", value / 1000.0); } static void add_cip_class_to_info_column(packet_info *pinfo, guint32 class_id, int display_type) diff --git a/epan/dissectors/packet-coap.c b/epan/dissectors/packet-coap.c index 3717f2ef1d..93f8160719 100644 --- a/epan/dissectors/packet-coap.c +++ b/epan/dissectors/packet-coap.c @@ -880,7 +880,7 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr return -1; } - g_snprintf(strbuf, sizeof(strbuf), + snprintf(strbuf, sizeof(strbuf), "#%u: %s", opt_count, val_to_str(*opt_num, vals_opt_type, *opt_num % 14 == 0 ? "No-Op" : "Unknown Option (%d)")); item = proto_tree_add_string(coap_tree, dissect_hf->hf.opt_name, @@ -889,7 +889,7 @@ dissect_coap_options_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tr coap_opt_check(pinfo, subtree, *opt_num, opt_length, dissect_hf); - g_snprintf(strbuf, sizeof(strbuf), + snprintf(strbuf, sizeof(strbuf), "Type %u, %s, %s%s", *opt_num, (*opt_num & 1) ? "Critical" : "Elective", (*opt_num & 2) ? "Unsafe" : "Safe", @@ -1095,7 +1095,7 @@ dissect_coap_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *coap_tree, p coap_ctype_str_dis = coinfo->ctype_str; } - g_snprintf(str_payload, sizeof(str_payload), + snprintf(str_payload, sizeof(str_payload), "Payload Content-Format: %s%s, Length: %u", coinfo->ctype_str, coinfo->ctype_value == DEFAULT_COAP_CTYPE_VALUE ? " (no Content-Format)" : "", payload_length); diff --git a/epan/dissectors/packet-collectd.c b/epan/dissectors/packet-collectd.c index ba26f2ada6..a130853e2f 100644 --- a/epan/dissectors/packet-collectd.c +++ b/epan/dissectors/packet-collectd.c @@ -481,7 +481,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf, else { pt = proto_tree_add_subtree_format(tree_root, tvb, offset, length, - ett_collectd_integer, &pi, "collectd %s segment: %"G_GINT64_MODIFIER"u", + ett_collectd_integer, &pi, "collectd %s segment: %"PRIu64, val_to_str_const (type, part_names, "UNKNOWN"), *ret_value); } @@ -542,7 +542,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt, val64 = tvb_get_ntoh64 (tvb, value_offset); value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6, val_cnt * 9, ett_collectd_valinfo, NULL, - "Counter: %"G_GINT64_MODIFIER"u", val64); + "Counter: %"PRIu64, val64); proto_tree_add_item (value_tree, hf_collectd_val_type, tvb, value_type_offset, 1, ENC_BIG_ENDIAN); @@ -577,7 +577,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt, val64 = tvb_get_ntoh64 (tvb, value_offset); value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6, val_cnt * 9, ett_collectd_valinfo, NULL, - "Derive: %"G_GINT64_MODIFIER"i", val64); + "Derive: %"PRIi64, val64); proto_tree_add_item (value_tree, hf_collectd_val_type, tvb, value_type_offset, 1, ENC_BIG_ENDIAN); @@ -594,7 +594,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt, val64 = tvb_get_ntoh64 (tvb, value_offset); value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6, val_cnt * 9, ett_collectd_valinfo, NULL, - "Absolute: %"G_GINT64_MODIFIER"u", val64); + "Absolute: %"PRIu64, val64); proto_tree_add_item (value_tree, hf_collectd_val_type, tvb, value_type_offset, 1, ENC_BIG_ENDIAN); @@ -611,7 +611,7 @@ dissect_collectd_values(tvbuff_t *tvb, gint msg_off, gint val_cnt, val64 = tvb_get_ntoh64 (tvb, value_offset); value_tree = proto_tree_add_subtree_format(values_tree, tvb, msg_off + 6, val_cnt * 9, ett_collectd_valinfo, NULL, - "Unknown: %"G_GINT64_MODIFIER"x", + "Unknown: %"PRIx64, val64); proto_tree_add_item (value_tree, hf_collectd_val_type, @@ -1241,7 +1241,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat { proto_item_set_text (pi, "collectd SEVERITY segment: " - "%s (%"G_GINT64_MODIFIER"u)", + "%s (%"PRIu64")", val64_to_str_const (ndispatch.severity, severity_names, "UNKNOWN"), ndispatch.severity); } diff --git a/epan/dissectors/packet-communityid.c b/epan/dissectors/packet-communityid.c index 6e72a602b6..f274305480 100644 --- a/epan/dissectors/packet-communityid.c +++ b/epan/dissectors/packet-communityid.c @@ -141,7 +141,7 @@ static void communityid_sha1_dbg(const gchar *msg, const void* data, gsize len) gsize i; for (i = 0; i < len; i++, ptr += 2) { - g_snprintf(ptr, 3, "%02x", ((guchar*)data)[i]); + snprintf(ptr, 3, "%02x", ((guchar*)data)[i]); } fprintf(stderr, "Community ID dbg [%s]: %s\n", msg, buf); @@ -379,7 +379,7 @@ static gboolean communityid_calc(communityid_cfg_t *cfg, guint8 proto, gsize len = strlen(CID_VERSION_PREFIX) + strlen(str) + 1; *result = (gchar*) g_malloc(len); - g_snprintf(*result, (gulong) len, "%s%s", CID_VERSION_PREFIX, str); + snprintf(*result, (gulong) len, "%s%s", CID_VERSION_PREFIX, str); g_free(str); } else { /* Convert binary SHA-1 to ASCII representation. @@ -392,7 +392,7 @@ static gboolean communityid_calc(communityid_cfg_t *cfg, guint8 proto, memcpy(*result, CID_VERSION_PREFIX, strlen(CID_VERSION_PREFIX)); ptr = *result + strlen(CID_VERSION_PREFIX); for (i = 0; i < sha1_buf_len; i++, ptr += 2) { - g_snprintf(ptr, 3, "%02x", sha1_buf[i]); + snprintf(ptr, 3, "%02x", sha1_buf[i]); } } diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c index 92f634e242..5c066e1b51 100644 --- a/epan/dissectors/packet-cops.c +++ b/epan/dissectors/packet-cops.c @@ -3019,7 +3019,7 @@ info_to_display(tvbuff_t *tvb, proto_item *stt, int offset, int octets, const ch } else if (mode==FMT_DEC && octets==8) { code64 = tvb_get_ntoh64(tvb, offset); pi = proto_tree_add_uint64_format(stt, *hf_proto_parameter, tvb, offset, octets, - code64, "%-28s : %" G_GINT64_MODIFIER "u", str, code64); + code64, "%-28s : %" PRIu64, str, code64); } else { pi = proto_tree_add_uint_format(stt, *hf_proto_parameter, tvb, offset, octets, code32,"%s",str); @@ -3062,7 +3062,7 @@ cops_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 op val_to_str(code16,table_cops_dqos_transaction_id, "Unknown (0x%04x)"),code16); /* Write the right data into the 'info field' on the Gui */ - g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"), + snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"), val_to_str_const(code16,table_cops_dqos_transaction_id, "Unknown")); col_add_str(pinfo->cinfo, COL_INFO,info); @@ -3448,7 +3448,7 @@ cops_mm_transaction_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *st, guint8 val_to_str(code16,table_cops_mm_transaction_id, "Unknown (0x%04x)"),code16); /* Write the right data into the 'info field' on the Gui */ - g_snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"), + snprintf(info,sizeof(info),"COPS %-20s - %s",val_to_str_const(op_code,cops_op_code_vals, "Unknown"), val_to_str_const(code16,table_cops_mm_transaction_id, "Unknown")); col_add_str(pinfo->cinfo, COL_INFO,info); diff --git a/epan/dissectors/packet-corosync-totemsrp.c b/epan/dissectors/packet-corosync-totemsrp.c index cc61e2a890..6f0feaf8a4 100644 --- a/epan/dissectors/packet-corosync-totemsrp.c +++ b/epan/dissectors/packet-corosync-totemsrp.c @@ -320,7 +320,7 @@ dissect_corosync_totemsrp_memb_ring_id(tvbuff_t *tvb, rid = corosync_totemsrp_get_guint64(tvb, offset, encoding); offset += 8; - proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u)", rid); + proto_item_append_text(item, " (ring: %" PRIu64 ")", rid); if (node_id) *node_id = nid; @@ -359,7 +359,7 @@ dissect_corosync_totemsrp_rtr_list(tvbuff_t *tvb, tvb, offset, 4, encoding); seq = corosync_totemsrp_get_guint32(tvb, offset, encoding); - proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u seq: %u)", + proto_item_append_text(item, " (ring: %" PRIu64 " node: %u seq: %u)", ring_id, node_id, seq); offset += 4; @@ -432,7 +432,7 @@ dissect_corosync_totemsrp_orf_token(tvbuff_t *tvb, encoding); } - proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u nrtr: %d seq: %d au: %u)", + proto_item_append_text(item, " (ring: %" PRIu64 " node: %u nrtr: %d seq: %d au: %u)", ring_id, node_id, rtr_list_entries, seq, aru); proto_item_set_len(item, offset - original_offset); @@ -513,7 +513,7 @@ dissect_corosync_totemsrp_mcast(tvbuff_t *tvb, &node_id, &ring_id); - proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u)", + proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)", ring_id, node_id); proto_tree_add_item(tree, hf_corosync_totemsrp_mcast_node_id, @@ -573,7 +573,7 @@ dissect_corosync_totemsrp_memb_merge_detect(tvbuff_t *tvb, &node_id, &ring_id); - proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u)", + proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)", ring_id, node_id); proto_item_set_len(item, offset - original_offset); @@ -751,7 +751,7 @@ dissect_corosync_totemsrp_memb_commit_token(tvbuff_t *tvb, NULL); } - proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u seq: %u entries: %u)", + proto_item_append_text(item, " (ring: %" PRIu64 " node: %u seq: %u entries: %u)", ring_id, node_id, seq, addr_entries); proto_item_set_len(item, offset - original_offset); @@ -780,7 +780,7 @@ dissect_corosync_totemsrp_token_hold_cancel(tvbuff_t *tvb, &node_id, &ring_id); - proto_item_append_text(item, " (ring: %" G_GINT64_MODIFIER "u node: %u)", + proto_item_append_text(item, " (ring: %" PRIu64 " node: %u)", ring_id, node_id); proto_item_set_len(item, offset - original_offset); diff --git a/epan/dissectors/packet-cose.c b/epan/dissectors/packet-cose.c index 5bfb651192..8e912d189a 100644 --- a/epan/dissectors/packet-cose.c +++ b/epan/dissectors/packet-cose.c @@ -366,7 +366,7 @@ static void dissect_header_pair(dissector_table_t dis_table, cose_header_context if (label) { key.label = ctx->label = g_variant_new_int64(*label); - label_str = wmem_strdup_printf(wmem_packet_scope(), "%" G_GINT64_FORMAT, *label); + label_str = wmem_strdup_printf(wmem_packet_scope(), "%" PRId64, *label); } break; } @@ -706,7 +706,7 @@ static int dissect_cose_msg_tagged(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (!dissector) { continue; } - g_log(LOG_DOMAIN, G_LOG_LEVEL_INFO, "main dissector using tag %" G_GUINT64_FORMAT, tag->value); + g_log(LOG_DOMAIN, G_LOG_LEVEL_INFO, "main dissector using tag %" PRIu64, tag->value); int sublen = call_dissector_only(dissector, tvb, pinfo, tree, tag); if (sublen > 0) { return sublen; diff --git a/epan/dissectors/packet-cpfi.c b/epan/dissectors/packet-cpfi.c index 5fd31316da..95e858f12e 100644 --- a/epan/dissectors/packet-cpfi.c +++ b/epan/dissectors/packet-cpfi.c @@ -181,7 +181,7 @@ dissect_cpfi_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) src_board = tda >> 4; src_port = tda & 0x0f; src = (1 << 24) + (src_instance << 16) + (src_board << 8) + src_port; - g_snprintf(src_str, sizeof(src_str), "%u.%u.%u", src_instance, src_board, src_port); + snprintf(src_str, sizeof(src_str), "%u.%u.%u", src_instance, src_board, src_port); } /* Figure out where the frame is going. srcTDA is destination of frame! */ @@ -203,7 +203,7 @@ dissect_cpfi_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dst_board = tda >> 4; dst_port = tda & 0x0f; dst = (1 << 24) + (dst_instance << 16) + (dst_board << 8) + dst_port; - g_snprintf(dst_str, sizeof(dst_str), "%u.%u.%u", dst_instance, dst_board, dst_port); + snprintf(dst_str, sizeof(dst_str), "%u.%u.%u", dst_instance, dst_board, dst_port); } /* Set up the source and destination and arrow per user configuration. */ diff --git a/epan/dissectors/packet-dccp.c b/epan/dissectors/packet-dccp.c index 76a34712b3..444fff565b 100644 --- a/epan/dissectors/packet-dccp.c +++ b/epan/dissectors/packet-dccp.c @@ -670,7 +670,7 @@ dissect_feature_options(proto_tree *dccp_options_tree, tvbuff_t *tvb, case 5: /* Ack Ratio */ if (option_len > 0) /* could be empty Confirm */ - proto_item_append_text(dccp_item, " %" G_GUINT64_FORMAT "", + proto_item_append_text(dccp_item, " %" PRIu64, dccp_ntoh_var(tvb, offset, option_len)); break; @@ -1049,7 +1049,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ if((dccp_relative_seq) && (dccpd->fwd->static_flags & DCCP_S_BASE_SEQ_SET)) { seq = dccph->seq - dccpd->fwd->base_seq; proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_seq, tvb, offset, 6, - seq, "%" G_GUINT64_FORMAT " (relative sequence number)", seq); + seq, "%" PRIu64 " (relative sequence number)", seq); } else { seq = dccph->seq; @@ -1069,7 +1069,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ if((dccp_relative_seq) && (dccpd->fwd->static_flags & DCCP_S_BASE_SEQ_SET)) { seq = (dccph->seq - dccpd->fwd->base_seq) & 0xffffff; proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_seq, tvb, offset, 3, - seq, "%" G_GUINT64_FORMAT " (relative sequence number)", seq); + seq, "%" PRIu64 " (relative sequence number)", seq); } else { seq = dccph->seq; @@ -1077,9 +1077,9 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ offset += 3; } if (dccp_summary_in_tree) { - proto_item_append_text(dccp_item, " Seq=%" G_GUINT64_FORMAT "", seq); + proto_item_append_text(dccp_item, " Seq=%" PRIu64, seq); } - col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%" G_GUINT64_FORMAT "", seq); + col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%" PRIu64, seq); /* dissecting type dependent additional fields */ switch (dccph->type) { @@ -1137,7 +1137,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ } proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 2, 6, dccph->ack); } - col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack); + col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack); offset += 8; /* move offset past the Acknowledgement Number Subheader */ dccph->service_code = tvb_get_ntohl(tvb, offset); @@ -1189,11 +1189,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ if (tree) { if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) { proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 2, 6, - ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack); + ack, "%" PRIu64 " (relative acknowledgement number)", ack); } proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 2, 6, dccph->ack); } - col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack); + col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack); offset += 8; /* move offset past the Ack Number Subheader */ } else { if (advertised_dccp_header_len < offset + 4) { @@ -1224,11 +1224,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ if (tree) { if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) { proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 1, 3, - ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack); + ack, "%" PRIu64 " (relative acknowledgement number)", ack); } proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 1, 3, dccph->ack); } - col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack); + col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack); offset += 4; /* move offset past the Ack. Number Subheader */ } break; @@ -1262,11 +1262,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ if (tree) { if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) { proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 1, 3, - ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack); + ack, "%" PRIu64 " (relative acknowledgement number)", ack); } proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 1, 3, dccph->ack); } - col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack); + col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack); offset += 8; /* move offset past the Ack. Number Subheader */ dccph->reset_code = tvb_get_guint8(tvb, offset); @@ -1322,11 +1322,11 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ if (tree) { if((dccp_relative_seq) && (dccpd->rev->static_flags & DCCP_S_BASE_SEQ_SET)) { proto_tree_add_uint64_format_value(dccp_tree, hf_dccp_ack, tvb, offset + 1, 3, - ack, "%" G_GUINT64_FORMAT " (relative acknowledgement number)", ack); + ack, "%" PRIu64 " (relative acknowledgement number)", ack); } proto_tree_add_uint64(dccp_tree, hf_dccp_ack_abs, tvb, offset + 1, 3, dccph->ack); } - col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" G_GUINT64_FORMAT ")", ack); + col_append_fstr(pinfo->cinfo, COL_INFO, " (Ack=%" PRIu64 ")", ack); offset += 8; /* move offset past the Ack. Number Subheader */ break; default: diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c index 21dd3d9515..d809e98647 100644 --- a/epan/dissectors/packet-dcerpc-epm.c +++ b/epan/dissectors/packet-dcerpc-epm.c @@ -447,7 +447,7 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset, static void epm_fmt_uuid_version( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } /* typedef struct { diff --git a/epan/dissectors/packet-dcerpc-ndr.c b/epan/dissectors/packet-dcerpc-ndr.c index cca348cd8c..c4640da00f 100644 --- a/epan/dissectors/packet-dcerpc-ndr.c +++ b/epan/dissectors/packet-dcerpc-ndr.c @@ -69,16 +69,16 @@ PIDL_dissect_uint8_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, switch (hf_info->display) { case BASE_DEC: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "%d", val); + snprintf(valstr, 64, "%d", val); } break; case BASE_HEX: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(0x%02x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(0x%02x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "0x%02x", val); + snprintf(valstr, 64, "0x%02x", val); } break; default: @@ -157,16 +157,16 @@ PIDL_dissect_uint16_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, switch (hf_info->display) { case BASE_DEC: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "%d", val); + snprintf(valstr, 64, "%d", val); } break; case BASE_HEX: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(0x%04x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(0x%04x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "0x%04x", val); + snprintf(valstr, 64, "0x%04x", val); } break; default: @@ -284,16 +284,16 @@ PIDL_dissect_uint32_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, switch (hf_info->display) { case BASE_DEC: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(%d)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "%d", val); + snprintf(valstr, 64, "%d", val); } break; case BASE_HEX: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(0x%08x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(0x%08x)",val_to_str(val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "0x%08x", val); + snprintf(valstr, 64, "0x%08x", val); } break; default: @@ -400,16 +400,16 @@ PIDL_dissect_uint64_val(tvbuff_t *tvb, gint offset, packet_info *pinfo, switch (hf_info->display) { case BASE_DEC: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(%" G_GINT64_MODIFIER "u)",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(%" PRIu64 ")",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "%" G_GINT64_MODIFIER "u", val); + snprintf(valstr, 64, "%" PRIu64, val); } break; case BASE_HEX: if (hf_info->strings) { - g_snprintf(valstr, 64, "%s(0x%" G_GINT64_MODIFIER "x)",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val); + snprintf(valstr, 64, "%s(0x%" PRIx64 ")",val_to_str( (guint32) val, (const value_string *)hf_info->strings, "Unknown:%u"), val); } else { - g_snprintf(valstr, 64, "0x%" G_GINT64_MODIFIER "x", val); + snprintf(valstr, 64, "0x%" PRIx64, val); } break; default: diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index 7bb8b03bf0..2e45251813 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -878,7 +878,7 @@ dcerpc_prompt(packet_info *pinfo, gchar* result) g_string_append(str, "&\r\n"); g_string_append_printf(str, "%s: %u\r\n", address_str->str, pinfo->destport); g_string_append_printf(str, "&\r\nContext ID: %u\r\n", decode_data->dcectxid); - g_string_append_printf(str, "&\r\nSMB FID: %"G_GINT64_MODIFIER"u\r\n", + g_string_append_printf(str, "&\r\nSMB FID: %"PRIu64"\r\n", dcerpc_get_transport_salt(pinfo)); g_string_append(str, "with:\r\n"); diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c index f5fc4f4645..14f7d601b1 100644 --- a/epan/dissectors/packet-dcom.c +++ b/epan/dissectors/packet-dcom.c @@ -249,7 +249,7 @@ void dcom_interface_dump(void) { for(objects = machine->objects; objects != NULL; objects = g_list_next(objects)) { object = (dcom_object_t *)objects->data; - /*ws_warning(" Object(#%4u): OID:0x%" G_GINT64_MODIFIER "x private:%p", object->first_packet, object->oid, object->private_data);*/ + /*ws_warning(" Object(#%4u): OID:0x%" PRIx64 " private:%p", object->first_packet, object->oid, object->private_data);*/ for(interfaces = object->interfaces; interfaces != NULL; interfaces = g_list_next(interfaces)) { interf = (dcom_interface_t *)interfaces->data; @@ -1384,7 +1384,7 @@ dissect_dcom_VARIANT(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_dcom_I8(tvb, offset, pinfo, NULL, di, drep, 0, &cyData); proto_tree_add_int64_format(sub_tree, hf_dcom_vt_cy, tvb, offset - 8, - 8, cyData, "%s: %" G_GINT64_FORMAT ".%.04" G_GINT64_FORMAT, + 8, cyData, "%s: %" PRId64 ".%.04" PRId64, proto_registrar_get_name(hf_dcom_vt_cy), cyData / 10000, ABS(cyData % 10000)); break; @@ -1616,7 +1616,7 @@ dcom_tvb_get_nwstringz0(tvbuff_t *tvb, gint offset, guint32 inLength, gchar *psz for(u32IdxA = 0, u32IdxW = 0; u32IdxW < u32Idx && u32IdxA < outLength-2; u32IdxW++, u32IdxA+=2) { - g_snprintf(&pszStr[u32IdxA], 3, "%02X", tvb_get_guint8(tvb, offset+u32IdxW)); + snprintf(&pszStr[u32IdxA], 3, "%02X", tvb_get_guint8(tvb, offset+u32IdxW)); } } diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c index 96c8ef63ae..4113022547 100644 --- a/epan/dissectors/packet-dhcpv6.c +++ b/epan/dissectors/packet-dhcpv6.c @@ -1806,14 +1806,14 @@ dissect_cablelabs_specific_opts(proto_tree *v_tree, proto_item *v_item, packet_i static void cablelabs_fmt_docsis_version( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } static void cablelabs_fmt_dpoe_server_version( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } diff --git a/epan/dissectors/packet-dlep.c b/epan/dissectors/packet-dlep.c index ae7fd4cbbe..2a7a979174 100644 --- a/epan/dissectors/packet-dlep.c +++ b/epan/dissectors/packet-dlep.c @@ -676,7 +676,7 @@ decode_dataitem_mdrr(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt, guint64 mdrr; proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_mdrr, tvb, offset, DLEP_DIT_MDRR_LEN, ENC_BIG_ENDIAN, &mdrr); - proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", mdrr); + proto_item_append_text(pi, ": %" PRIu64 " (bps)", mdrr); offset+=DLEP_DIT_MDRR_LEN; if (len != DLEP_DIT_MDRR_LEN) @@ -692,7 +692,7 @@ decode_dataitem_mdrt(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt, guint64 mdrt; proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_mdrt, tvb, offset, DLEP_DIT_MDRT_LEN, ENC_BIG_ENDIAN, &mdrt); - proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", mdrt); + proto_item_append_text(pi, ": %" PRIu64 " (bps)", mdrt); offset+=DLEP_DIT_MDRT_LEN; if (len != DLEP_DIT_MDRT_LEN) @@ -708,7 +708,7 @@ decode_dataitem_cdrr(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt, guint64 cdrr; proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_cdrr, tvb, offset, DLEP_DIT_CDRR_LEN, ENC_BIG_ENDIAN, &cdrr); - proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", cdrr); + proto_item_append_text(pi, ": %" PRIu64 " (bps)", cdrr); offset+=DLEP_DIT_CDRR_LEN; if (len != DLEP_DIT_CDRR_LEN) @@ -724,7 +724,7 @@ decode_dataitem_cdrt(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *pt, guint64 cdrt; proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_cdrt, tvb, offset, DLEP_DIT_CDRT_LEN, ENC_BIG_ENDIAN, &cdrt); - proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (bps)", cdrt); + proto_item_append_text(pi, ": %" PRIu64 " (bps)", cdrt); offset+=DLEP_DIT_CDRT_LEN; if (len != DLEP_DIT_CDRT_LEN) @@ -740,7 +740,7 @@ decode_dataitem_latency(tvbuff_t *tvb, int offset, proto_item *pi, proto_tree *p guint64 latency; proto_tree_add_item_ret_uint64(pt, hf_dlep_dataitem_latency, tvb, offset, DLEP_DIT_LAT_LEN, ENC_BIG_ENDIAN, &latency); - proto_item_append_text(pi, ": %" G_GUINT64_FORMAT " (us)", latency); + proto_item_append_text(pi, ": %" PRIu64 " (us)", latency); offset+=DLEP_DIT_LAT_LEN; if (len != DLEP_DIT_LAT_LEN) diff --git a/epan/dissectors/packet-dlsw.c b/epan/dissectors/packet-dlsw.c index 4d0e031251..6ed6377508 100644 --- a/epan/dissectors/packet-dlsw.c +++ b/epan/dissectors/packet-dlsw.c @@ -411,7 +411,7 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data static void dlsw_fmt_version( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } static void diff --git a/epan/dissectors/packet-dlt.c b/epan/dissectors/packet-dlt.c index e1bf5b5ba5..8d8567f784 100644 --- a/epan/dissectors/packet-dlt.c +++ b/epan/dissectors/packet-dlt.c @@ -529,7 +529,7 @@ dissect_dlt_verbose_parameter_int(tvbuff_t *tvb, packet_info *pinfo, proto_tree } } - col_append_fstr(pinfo->cinfo, COL_INFO, " %" G_GINT64_FORMAT, value); + col_append_fstr(pinfo->cinfo, COL_INFO, " %" PRId64, value); return length; } @@ -588,7 +588,7 @@ dissect_dlt_verbose_parameter_uint(tvbuff_t *tvb, packet_info *pinfo, proto_tree } } - col_append_fstr(pinfo->cinfo, COL_INFO, " %" G_GUINT64_FORMAT, value); + col_append_fstr(pinfo->cinfo, COL_INFO, " %" PRIu64, value); return length; } diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index 970d36bf60..c1a07ac52a 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -1265,7 +1265,7 @@ static gboolean dmp_dec_xbyte_sic (guint64 bin, gchar *sic, if (no_char >= MAX_SIC_LEN) { /* Illegal length */ - g_snprintf (sic, MAX_SIC_LEN, "Illegal length: %d", no_char); + snprintf (sic, MAX_SIC_LEN, "Illegal length: %d", no_char); return TRUE; } @@ -1725,7 +1725,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, } else if (key <= 0xBF) { /* Reserved (not used) */ - g_snprintf (sic, MAX_SIC_LEN, "Reserved"); + snprintf (sic, MAX_SIC_LEN, "Reserved"); no_sic = TRUE; } else if (key <= 0xCF) { @@ -1860,7 +1860,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, failure = dmp_dec_xbyte_sic (value, sic, length, any); bf = proto_tree_add_string_format (sic_tree, hf_message_sic, tvb, offset, bytes, sic, - "SIC %d: %s (%d bytes: %" G_GINT64_MODIFIER "x)%s", + "SIC %d: %s (%d bytes: %" PRIx64 ")%s", i + 1, sic, bytes, value, failure ? " (invalid)": ""); if (bitmap & (1 << (7 - i))) { @@ -1882,12 +1882,12 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, } else if (key == 0xFE) { /* No SIC */ - g_snprintf (sic, MAX_SIC_LEN, "Not present"); + snprintf (sic, MAX_SIC_LEN, "Not present"); no_sic = TRUE; } else { /* Resered (not used) */ - g_snprintf (sic, MAX_SIC_LEN, "Reserved"); + snprintf (sic, MAX_SIC_LEN, "Reserved"); no_sic = TRUE; } diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 1d7d0a18d9..b6c1f25710 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -1430,7 +1430,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset, label_len = (bit_count - 1) / 8 + 1; if (maxname > 0) { - print_len = g_snprintf(np, maxname, "\\[x"); + print_len = snprintf(np, maxname, "\\[x"); if (print_len <= maxname) { np += print_len; maxname -= print_len; @@ -1442,7 +1442,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset, } while (label_len--) { if (maxname > 0) { - print_len = g_snprintf(np, maxname, "%02x", + print_len = snprintf(np, maxname, "%02x", tvb_get_guint8(tvb, offset)); if (print_len <= maxname) { np += print_len; @@ -1456,7 +1456,7 @@ expand_dns_name(tvbuff_t *tvb, int offset, int max_len, int dns_data_offset, offset++; } if (maxname > 0) { - print_len = g_snprintf(np, maxname, "/%d]", bit_count); + print_len = snprintf(np, maxname, "/%d]", bit_count); if (print_len <= maxname) { np += print_len; maxname -= print_len; @@ -1614,7 +1614,7 @@ rfc1867_angle(tvbuff_t *tvb, int offset, gboolean longitude) if (longitude ? (angle > 648000000) : (angle > 324000000)) { - g_snprintf(buf, sizeof(buf), "Value out of range"); + snprintf(buf, sizeof(buf), "Value out of range"); return buf; } @@ -1625,7 +1625,7 @@ rfc1867_angle(tvbuff_t *tvb, int offset, gboolean longitude) minutes = angle % 60; degrees = angle / 60; - g_snprintf(buf, sizeof(buf), "%u deg %u min %u.%03u sec %c", degrees, minutes, secs, + snprintf(buf, sizeof(buf), "%u deg %u min %u.%03u sec %c", degrees, minutes, secs, tsecs, direction); return buf; } diff --git a/epan/dissectors/packet-docsis-macmgmt.c b/epan/dissectors/packet-docsis-macmgmt.c index 72f28d4d2f..02bd30ea1a 100644 --- a/epan/dissectors/packet-docsis-macmgmt.c +++ b/epan/dissectors/packet-docsis-macmgmt.c @@ -1616,7 +1616,7 @@ two_compl_frac( gint16 frac = value; - g_snprintf(buf, ITEM_LABEL_LENGTH, + snprintf(buf, ITEM_LABEL_LENGTH, "%f", frac/16384.0); } @@ -2492,31 +2492,31 @@ static const unit_name_string local_units_hz = { "Hz", NULL }; static void ofdma_ir_pow_ctrl_start_pow(char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%f dBmV/1.6MHz", value/4.0); + snprintf(buf, ITEM_LABEL_LENGTH, "%f dBmV/1.6MHz", value/4.0); } static void ofdma_ir_pow_ctrl_step_size(char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0); + snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0); } static void fourth_db(char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0); + snprintf(buf, ITEM_LABEL_LENGTH, "%f dB", value/4.0); } static void subc_assign_range(char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u - %u", value >> 16, value &0xFFFF); + snprintf(buf, ITEM_LABEL_LENGTH, "%u - %u", value >> 16, value &0xFFFF); } static void multipart_number_of_fragments(char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u (Actual Number of Fragments: %u)", value, value + 1); + snprintf(buf, ITEM_LABEL_LENGTH, "%u (Actual Number of Fragments: %u)", value, value + 1); } static reassembly_table docsis_tlv_reassembly_table; diff --git a/epan/dissectors/packet-docsis-tlv.c b/epan/dissectors/packet-docsis-tlv.c index f31cedf09f..6ded4f83ed 100644 --- a/epan/dissectors/packet-docsis-tlv.c +++ b/epan/dissectors/packet-docsis-tlv.c @@ -913,13 +913,13 @@ static const value_string docsis_time_prot_perf_sup_vals[] = { static void fourth_db(char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dB", value/4.0); + snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dB", value/4.0); } static void fourth_dbmv(char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dBmV", value/4.0); + snprintf(buf, ITEM_LABEL_LENGTH, "%.2f dBmV", value/4.0); } static reassembly_table ucd_reassembly_table; diff --git a/epan/dissectors/packet-drbd.c b/epan/dissectors/packet-drbd.c index 28c2084717..c125306db9 100644 --- a/epan/dissectors/packet-drbd.c +++ b/epan/dissectors/packet-drbd.c @@ -1164,7 +1164,7 @@ static void decode_payload_uuids110(tvbuff_t *tvb, proto_tree *tree, drbd_conv * if (is_bit_set_64(bitmap_uuids_mask, i)) { guint64 bitmap_uuid = tvb_get_ntoh64(tvb, offset); proto_tree_add_uint64_format(tree, hf_drbd_bitmap_uuid, tvb, offset, 8, bitmap_uuid, - "Bitmap UUID for node %d: 0x%016" G_GINT64_MODIFIER "x", i, bitmap_uuid); + "Bitmap UUID for node %d: 0x%016" PRIx64, i, bitmap_uuid); offset += 8; } } @@ -1306,11 +1306,11 @@ static void format_node_mask(gchar *s, guint64 value) const char *sep = written ? ", " : ""; if (run_length == 1) - written += g_snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d", sep, run_start); + written += snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d", sep, run_start); else if (run_length == 2) - written += g_snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d, %d", sep, run_start, run_start + 1); + written += snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d, %d", sep, run_start, run_start + 1); else - written += g_snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d - %d", sep, run_start, run_end - 1); + written += snprintf(s + written, ITEM_LABEL_LENGTH - written, "%s%d - %d", sep, run_start, run_end - 1); } if (!is_set) diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c index 60571623e8..be3fe72449 100644 --- a/epan/dissectors/packet-dtls.c +++ b/epan/dissectors/packet-dtls.c @@ -900,7 +900,7 @@ dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo, /* * now dissect the next layer */ - ssl_debug_printf("dissect_dtls_record: content_type %d epoch %d seq %"G_GUINT64_FORMAT"\n", content_type, epoch, sequence_number); + ssl_debug_printf("dissect_dtls_record: content_type %d epoch %d seq %"PRIu64"\n", content_type, epoch, sequence_number); /* try to decrypt record on the first pass, if possible. Store decrypted * record for later usage (without having to decrypt again). */ @@ -1825,7 +1825,7 @@ dtls_src_prompt(packet_info *pinfo, gchar *result) if (pi != NULL) srcport = pi->srcport; - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW); } static gpointer @@ -1850,7 +1850,7 @@ dtls_dst_prompt(packet_info *pinfo, gchar *result) if (pi != NULL) destport = pi->destport; - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, destport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, destport); } static gpointer @@ -1879,7 +1879,7 @@ dtls_both_prompt(packet_info *pinfo, gchar *result) destport = pi->destport; } - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); } void proto_reg_handoff_dtls(void); diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c index 1a18e0be4f..e2733bfe47 100644 --- a/epan/dissectors/packet-dvbci.c +++ b/epan/dissectors/packet-dvbci.c @@ -4200,8 +4200,8 @@ dissect_dvbci_payload_sas(guint32 tag, gint len_field _U_, switch(tag) { case T_SAS_CONNECT_RQST: case T_SAS_CONNECT_CNF: - g_snprintf(app_id_str, sizeof(app_id_str), - "0x%016" G_GINT64_MODIFIER "x", tvb_get_ntoh64(tvb, offset)); + snprintf(app_id_str, sizeof(app_id_str), + "0x%016" PRIx64, tvb_get_ntoh64(tvb, offset)); col_append_sep_str(pinfo->cinfo, COL_INFO, ": ", app_id_str); proto_tree_add_item(tree, hf_dvbci_sas_app_id, tvb, offset, 8, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-ecmp.c b/epan/dissectors/packet-ecmp.c index 578e5ecc1f..5b0ed6a954 100644 --- a/epan/dissectors/packet-ecmp.c +++ b/epan/dissectors/packet-ecmp.c @@ -1199,11 +1199,11 @@ static int display_raw_cyclic_data(guint8 display, int offset, guint16 buffer_si /* we hit end of the current line */ /* add final value to string */ if (display == cyclic_display_byte_format) { - g_snprintf(&pdata[idx], 32, "%02x",value8); + snprintf(&pdata[idx], 32, "%02x",value8); } else if (display == cyclic_display_word_format) { - g_snprintf(&pdata[idx], 32, "%04x",value16); + snprintf(&pdata[idx], 32, "%04x",value16); } else if (display == cyclic_display_long_format) { - g_snprintf(&pdata[idx], 32, "%08x",value32); + snprintf(&pdata[idx], 32, "%08x",value32); } /* display the completed line in the sub-tree */ @@ -1218,13 +1218,13 @@ static int display_raw_cyclic_data(guint8 display, int offset, guint16 buffer_si /* we're still adding to the current line */ /* add current value to string */ if (display == cyclic_display_byte_format) { - g_snprintf(&pdata[idx], 32, "%02x ",value8); + snprintf(&pdata[idx], 32, "%02x ",value8); idx += 3; } else if (display == cyclic_display_word_format) { - g_snprintf(&pdata[idx], 32, "%04x ",value16); + snprintf(&pdata[idx], 32, "%04x ",value16); idx += 5; } else if (display == cyclic_display_long_format) { - g_snprintf(&pdata[idx], 32, "%08x ",value32); + snprintf(&pdata[idx], 32, "%08x ",value32); idx += 9; } } diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c index 4b5d10d2f6..5603eeeab7 100644 --- a/epan/dissectors/packet-edonkey.c +++ b/epan/dissectors/packet-edonkey.c @@ -2408,7 +2408,7 @@ static int dissect_kademlia_tag(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item( subtree, hf_kademlia_tag_uint64, tvb, offset, 8, ENC_LITTLE_ENDIAN); value = tvb_get_letoh64( tvb, offset ); - proto_item_append_text( tag_node, "%" G_GINT64_MODIFIER "u (0x%08" G_GINT64_MODIFIER "X)", value, value ); + proto_item_append_text( tag_node, "%" PRIu64 " (0x%08" PRIX64 ")", value, value ); offset += 8; } @@ -3082,7 +3082,7 @@ static int dissect_edonkey_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr static void edonkey_fmt_revision(gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(revision & 0xFFFF), (guint16)(( revision & 0xFFFF0000 ) >> 16) ); + snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(revision & 0xFFFF), (guint16)(( revision & 0xFFFF0000 ) >> 16) ); } void proto_register_edonkey(void) { diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c index 94ace902f7..57fa063bef 100644 --- a/epan/dissectors/packet-eigrp.c +++ b/epan/dissectors/packet-eigrp.c @@ -2553,19 +2553,19 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ static void eigrp_fmt_cable_range(gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%u-%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%u-%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) ); } static void eigrp_fmt_nexthop_address(gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint16)(( revision & 0xFFFF0000 ) >> 16), (guint16)(revision & 0xFFFF) ); } static void eigrp_fmt_version(gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } /** diff --git a/epan/dissectors/packet-elasticsearch.c b/epan/dissectors/packet-elasticsearch.c index 6062d8ff84..19e53c593b 100644 --- a/epan/dissectors/packet-elasticsearch.c +++ b/epan/dissectors/packet-elasticsearch.c @@ -129,7 +129,7 @@ static const value_string status_flag_message_type[] = { }; static void elasticsearch_format_version(gchar *buf, guint32 value) { - g_snprintf(buf, ELASTICSEARCH_VERSION_LABEL_LENGTH, "%d.%d.%d (%d)", (value / 1000000) % 100, + snprintf(buf, ELASTICSEARCH_VERSION_LABEL_LENGTH, "%d.%d.%d (%d)", (value / 1000000) % 100, (value / 10000) % 100, (value/ 100) % 100, value); } @@ -257,7 +257,7 @@ static version_t elasticsearch_parse_version(tvbuff_t *tvb, int offset){ raw_version_value = read_vint(tvb, offset); version.length = raw_version_value.length; version.value = raw_version_value.value; - g_snprintf(version.string, sizeof(version.string), "%d.%d.%d", (version.value / 1000000) % 100, + snprintf(version.string, sizeof(version.string), "%d.%d.%d", (version.value / 1000000) % 100, (version.value / 10000) % 100, (version.value/ 100) % 100); return version; @@ -532,7 +532,7 @@ static int elasticsearch_dissect_valid_binary_packet(tvbuff_t *tvb, packet_info } else { elasticsearch_decode_binary_response(tvb, pinfo, tree, offset, transport_status_flags, version); } - col_append_fstr(pinfo->cinfo, COL_INFO, "request_id=%"G_GUINT64_FORMAT" ", request_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "request_id=%"PRIu64" ", request_id); /* Everything is marked as data, return the whole tvb as the length */ diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c index 0fc8c31e9f..9136105642 100644 --- a/epan/dissectors/packet-enip.c +++ b/epan/dissectors/packet-enip.c @@ -789,7 +789,7 @@ static const true_false_string dlr_lnknbrstatus_frame_type_vals = { static void enip_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect unidentified I/O traffic as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect unidentified I/O traffic as"); } static wmem_map_t *enip_request_hashtable = NULL; @@ -846,7 +846,7 @@ enip_request_equal(gconstpointer v, gconstpointer w) static void enip_fmt_lir_revision( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } static guint diff --git a/epan/dissectors/packet-epl-profile-parser.c b/epan/dissectors/packet-epl-profile-parser.c index c7c6e22cad..b4adc42458 100644 --- a/epan/dissectors/packet-epl-profile-parser.c +++ b/epan/dissectors/packet-epl-profile-parser.c @@ -752,7 +752,7 @@ epl_wmem_print_iarr(epl_wmem_iarray_t *iarr) for (i = 0; i < len; i++) { - ws_debug_printf("Range: low=%" G_GUINT32_FORMAT " high=%" G_GUINT32_FORMAT "\n", elem->low, elem->high); + ws_debug_printf("Range: low=%" PRIu32 " high=%" PRIu32 "\n", elem->low, elem->high); elem = (range_admin_t*)((char*)elem + g_array_get_element_size(iarr->arr)); } diff --git a/epan/dissectors/packet-epl.c b/epan/dissectors/packet-epl.c index 77b3a6f306..076ada62a6 100644 --- a/epan/dissectors/packet-epl.c +++ b/epan/dissectors/packet-epl.c @@ -2502,7 +2502,7 @@ epl_set_sequence_nr(packet_info *pinfo, guint16 seqnum) static void elp_version( gchar *result, guint32 version ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%d", hi_nibble(version), lo_nibble(version)); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%d", hi_nibble(version), lo_nibble(version)); } /* Code to actually dissect the packets */ static int @@ -2807,7 +2807,7 @@ dissect_epl_payload(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gin guint64 val; item = proto_tree_add_item_ret_uint64(epl_tree, *type->hf, tvb, offset, type->len, type->encoding, &val); - proto_item_append_text(item, " (0x%.*" G_GINT64_MODIFIER "x)", 2*type->len, val); + proto_item_append_text(item, " (0x%.*" PRIx64 ")", 2*type->len, val); } } /* If a mapping uses a type of fixed width that's not equal to @@ -2821,7 +2821,7 @@ dissect_epl_payload(proto_tree *epl_tree, tvbuff_t *tvb, packet_info *pinfo, gin guint64 val; item = proto_tree_add_item_ret_uint64(epl_tree, hf_epl_od_uint, payload_tvb, 0, payload_len, ENC_LITTLE_ENDIAN, &val); - proto_item_append_text(item, " (0x%.*" G_GINT64_MODIFIER "x)", 2*payload_len, val); + proto_item_append_text(item, " (0x%.*" PRIx64 ")", 2*payload_len, val); } else { @@ -4330,9 +4330,9 @@ dissect_object_mapping(struct profile *profile, wmem_array_t *mappings, proto_tr { /* TODO One could think of a better string here? */ if (nosub) - g_snprintf(map.title, sizeof(map.title), "PDO - %04X", map.pdo.idx); + snprintf(map.title, sizeof(map.title), "PDO - %04X", map.pdo.idx); else - g_snprintf(map.title, sizeof(map.title), "PDO - %04X:%02X", map.pdo.idx, map.pdo.subindex); + snprintf(map.title, sizeof(map.title), "PDO - %04X:%02X", map.pdo.idx, map.pdo.subindex); add_object_mapping(mappings, &map); } diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index 74593c6dcf..7784534409 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -1853,7 +1853,7 @@ static void dissect_host_anchor_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree proto_tree *subtree; /* TODO: top level linking to most recent frame like we have for Host ID? */ - subtree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_erf_anchor, &pi, "Host ID: 0x%012" G_GINT64_MODIFIER "x, Anchor ID: 0x%012" G_GINT64_MODIFIER "x", host_id & ERF_EHDR_HOST_ID_MASK, anchor_id & ERF_EHDR_ANCHOR_ID_MASK); + subtree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_erf_anchor, &pi, "Host ID: 0x%012" PRIx64 ", Anchor ID: 0x%012" PRIx64, host_id & ERF_EHDR_HOST_ID_MASK, anchor_id & ERF_EHDR_ANCHOR_ID_MASK); proto_item_set_generated(pi); pi = proto_tree_add_uint64(subtree, hf_erf_anchor_hostid, tvb, 0, 0, host_id & ERF_EHDR_HOST_ID_MASK); @@ -1907,12 +1907,12 @@ dissect_host_id_source_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g if (fnum_current != G_MAXUINT32) { pi = proto_tree_add_uint_format(tree, hf_erf_source_current, tvb, 0, 0, fnum_current, - "Host ID: 0x%012" G_GINT64_MODIFIER "x, Source ID: %u", host_id, source_id&0xFF); + "Host ID: 0x%012" PRIx64 ", Source ID: %u", host_id, source_id&0xFF); hostid_tree = proto_item_add_subtree(pi, ett_erf_source); } else { /* If we have no frame number to link against, just add a static subtree */ hostid_tree = proto_tree_add_subtree_format(tree, tvb, 0, 0, ett_erf_source, &pi, - "Host ID: 0x%012" G_GINT64_MODIFIER "x, Source ID: %u", host_id, source_id&0xFF); + "Host ID: 0x%012" PRIx64 ", Source ID: %u", host_id, source_id&0xFF); } proto_item_set_generated(pi); @@ -2776,7 +2776,7 @@ dissect_meta_record_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case ERF_META_TAG_if_tx_speed: value64 = tvb_get_ntoh64(tvb, offset + 4); tmp = format_size((int64_t)value64, FORMAT_SIZE_UNIT_BITS_S, FORMAT_SIZE_PREFIX_SI); - tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" G_GINT64_MODIFIER "u bps)", tmp, value64); + tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" PRIu64 " bps)", tmp, value64); g_free(tmp); break; @@ -2807,7 +2807,7 @@ dissect_meta_record_tags(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case ERF_META_TAG_mem: value64 = tvb_get_ntoh64(tvb, offset + 4); tmp = format_size((int64_t)value64, FORMAT_SIZE_UNIT_BYTES, FORMAT_SIZE_PREFIX_IEC); - tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" G_GINT64_MODIFIER"u bytes)", tmp, value64); + tag_pi = proto_tree_add_uint64_format_value(section_tree, tag_info->hf_value, tvb, offset + 4, taglength, value64, "%s (%" PRIu64" bytes)", tmp, value64); g_free(tmp); break; diff --git a/epan/dissectors/packet-erldp.c b/epan/dissectors/packet-erldp.c index 4d6d83bfd2..6e58cd6760 100644 --- a/epan/dissectors/packet-erldp.c +++ b/epan/dissectors/packet-erldp.c @@ -393,9 +393,9 @@ static gint dissect_etf_big_ext(tvbuff_t *tvb, gint offset, guint32 len, proto_t case 8: big_val = tvb_get_letoh64(tvb, offset); break; } proto_tree_add_uint64_format_value(tree, hf_erldp_big_ext_int, tvb, offset, len, - big_val, "%s%" G_GINT64_MODIFIER "u", sign ? "-" : "", big_val); + big_val, "%s%" PRIu64, sign ? "-" : "", big_val); if (value_str) - *value_str = wmem_strdup_printf(wmem_packet_scope(), "%s%" G_GINT64_MODIFIER "u", + *value_str = wmem_strdup_printf(wmem_packet_scope(), "%s%" PRIu64, sign ? "-" : "", big_val); } if (len < 64) { wmem_strbuf_t *strbuf = wmem_strbuf_sized_new(wmem_packet_scope(), len*1+3+1, len*1+3+1); @@ -595,7 +595,7 @@ static gint dissect_etf_type_content(guint8 tag, packet_info *pinfo, tvbuff_t *t for (i = 0; i < len; i++) { gchar buf[ITEM_LABEL_LENGTH]; - g_snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1); + snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1); offset = dissect_etf_type(buf, pinfo, tvb, offset, tree); } break; @@ -618,7 +618,7 @@ static gint dissect_etf_type_content(guint8 tag, packet_info *pinfo, tvbuff_t *t for (i = 0; i < len; i++) { gchar buf[ITEM_LABEL_LENGTH]; - g_snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1); + snprintf(buf, sizeof(buf), "Free Var[%u]", i + 1); offset = dissect_etf_type(buf, pinfo, tvb, offset, tree); } break; @@ -707,7 +707,7 @@ static gint dissect_etf_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, { /* make a new subset */ next_tvb = tvb_new_subset_remaining(tvb, offset); call_data_dissector(next_tvb, pinfo, tree); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Fragment ID: %" G_GUINT64_FORMAT ")", fragment_id); + col_append_fstr(pinfo->cinfo, COL_INFO, " (Fragment ID: %" PRIu64 ")", fragment_id); } else { @@ -715,7 +715,7 @@ static gint dissect_etf_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item_set_len(ti, offset); dissect_etf_pdu_data(pinfo, next_tvb, offset, tree); - col_append_fstr(pinfo->cinfo, COL_INFO, " (Reassembled, Fragment ID: %" G_GUINT64_FORMAT ")", fragment_id); + col_append_fstr(pinfo->cinfo, COL_INFO, " (Reassembled, Fragment ID: %" PRIu64 ")", fragment_id); } pinfo->fragmented = save_fragmented; diff --git a/epan/dissectors/packet-etag.c b/epan/dissectors/packet-etag.c index 2c44e5408a..f32195ffab 100644 --- a/epan/dissectors/packet-etag.c +++ b/epan/dissectors/packet-etag.c @@ -136,7 +136,7 @@ dissect_etag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ ing_e_cid = (guint32)((((tci >> 32) & 0xFFF) | ((tci << 4) & 0xFF000)) & 0xFFFFF); /* Ingress_E-CID_base | Ingress_E-CID ext */ if (etag_summary_in_tree) { - proto_item_append_text(ti, ", TCI: 0x%" G_GINT64_MODIFIER "x Ingress_E-CID: %u E-CID: %u", tci, ing_e_cid, e_cid); + proto_item_append_text(ti, ", TCI: 0x%" PRIx64 " Ingress_E-CID: %u E-CID: %u", tci, ing_e_cid, e_cid); } etag_tree = proto_item_add_subtree(ti, ett_etag); diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c index 7cb41bdab3..3eb5405f79 100644 --- a/epan/dissectors/packet-ethertype.c +++ b/epan/dissectors/packet-ethertype.c @@ -196,7 +196,7 @@ const value_string etype_vals[] = { static void eth_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Ethertype 0x%04x as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Ethertype 0x%04x as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, pinfo->curr_layer_num))); } diff --git a/epan/dissectors/packet-f5ethtrailer.c b/epan/dissectors/packet-f5ethtrailer.c index f3f8d75a56..7924d8075c 100644 --- a/epan/dissectors/packet-f5ethtrailer.c +++ b/epan/dissectors/packet-f5ethtrailer.c @@ -714,7 +714,7 @@ f5eth_tmmdist_stats_tree_packet( if(check_f5eth_tap_magic(tdata) == 0) return TAP_PACKET_DONT_REDRAW; */ - g_snprintf(tmm_stat_name_buffer, PER_TMM_STAT_NAME_BUF_LEN, "slot %3d,tmm %3d", tdata->slot, + snprintf(tmm_stat_name_buffer, PER_TMM_STAT_NAME_BUF_LEN, "slot %3d,tmm %3d", tdata->slot, tdata->tmm); pkt_len = pinfo->fd->pkt_len - tdata->trailer_len; @@ -1915,12 +1915,12 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o rstcauseline = (rstcauseval & 0x000000000000ffffLL); rstcauseval = (rstcauseval & 0xffffffffffff0000LL) >> 16; proto_tree_add_uint64_format_value(rc_tree, hf_rstcause_val, tvb, o, 6, - rstcauseval, "0x%012" G_GINT64_MODIFIER "x", rstcauseval); + rstcauseval, "0x%012" PRIx64, rstcauseval); proto_tree_add_item(rc_tree, hf_rstcause_line, tvb, o + 6, 2, ENC_BIG_ENDIAN); o += 8; proto_item_append_text(rc_item, - ": [%" G_GINT64_MODIFIER "x:%" G_GINT64_MODIFIER "u]%s %s", rstcauseval, + ": [%" PRIx64 ":%" PRIu64 "]%s %s", rstcauseval, rstcauseline, rstcausepeer ? " {peer}" : "", tvb_get_string_enc(pinfo->pool, tvb, o, rstcauselen - (o - startcause), ENC_ASCII)); @@ -2361,12 +2361,12 @@ dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre rstcauseline = (rstcauseval & 0x000000000000ffffLL); rstcauseval = (rstcauseval & 0xffffffffffff0000LL) >> 16; proto_tree_add_uint64_format_value(rc_tree, hf_rstcause_val, tvb, o, 6, rstcauseval, - "0x%012" G_GINT64_MODIFIER "x", rstcauseval); + "0x%012" PRIx64, rstcauseval); proto_tree_add_item(rc_tree, hf_rstcause_line, tvb, o + 6, 2, ENC_BIG_ENDIAN); o += 8; proto_item_append_text(rc_item, - ": [%" G_GINT64_MODIFIER "x:%" G_GINT64_MODIFIER "u]%s %s", rstcauseval, + ": [%" PRIx64 ":%" PRIu64 "]%s %s", rstcauseval, rstcauseline, rstcausepeer ? " {peer}" : "", tvb_get_string_enc( pinfo->pool, tvb, o, rstcauselen - (o - startcause), ENC_ASCII)); diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c index f6e8c82f3c..50ca480f6c 100644 --- a/epan/dissectors/packet-fcswils.c +++ b/epan/dissectors/packet-fcswils.c @@ -752,19 +752,19 @@ dissect_swils_elp(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *elp_tree, g flagsbuf=(char *)wmem_alloc(wmem_packet_scope(), MAX_FLAGS_LEN); stroff = 0; - returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, + returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, "Class 1 Valid"); stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff); if (cls1_svcparm[0] & 0x40) { - returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX"); + returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX"); stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff); } if (cls1_svcparm[0] & 0x20) { - returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS"); + returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS"); stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff); } if (cls1_svcparm[0] & 0x10) { - /*returned_length =*/ g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS"); + /*returned_length =*/ snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS"); } flags=flagsbuf; } diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c index 26a7aac131..eb33c43e7b 100644 --- a/epan/dissectors/packet-fddi.c +++ b/epan/dissectors/packet-fddi.c @@ -260,35 +260,35 @@ fddifc_to_str(int fc) switch (fc & FDDI_FC_CLFF) { case FDDI_FC_MAC: - g_snprintf(strbuf, sizeof(strbuf), "MAC frame, control %x", fc & FDDI_FC_ZZZZ); + snprintf(strbuf, sizeof(strbuf), "MAC frame, control %x", fc & FDDI_FC_ZZZZ); return strbuf; case FDDI_FC_SMT: - g_snprintf(strbuf, sizeof(strbuf), "SMT frame, control %x", fc & FDDI_FC_ZZZZ); + snprintf(strbuf, sizeof(strbuf), "SMT frame, control %x", fc & FDDI_FC_ZZZZ); return strbuf; case FDDI_FC_LLC_ASYNC: if (fc & FDDI_FC_ASYNC_R) - g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, control %x", fc & FDDI_FC_ZZZZ); + snprintf(strbuf, sizeof(strbuf), "Async LLC frame, control %x", fc & FDDI_FC_ZZZZ); else - g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, priority %d", + snprintf(strbuf, sizeof(strbuf), "Async LLC frame, priority %d", fc & FDDI_FC_ASYNC_PRI); return strbuf; case FDDI_FC_LLC_SYNC: if (fc & FDDI_FC_ZZZZ) { - g_snprintf(strbuf, sizeof(strbuf), "Sync LLC frame, control %x", fc & FDDI_FC_ZZZZ); + snprintf(strbuf, sizeof(strbuf), "Sync LLC frame, control %x", fc & FDDI_FC_ZZZZ); return strbuf; } else return "Sync LLC frame"; case FDDI_FC_IMP_ASYNC: - g_snprintf(strbuf, sizeof(strbuf), "Implementor async frame, control %x", + snprintf(strbuf, sizeof(strbuf), "Implementor async frame, control %x", fc & FDDI_FC_ZZZZ); return strbuf; case FDDI_FC_IMP_SYNC: - g_snprintf(strbuf, sizeof(strbuf), "Implementor sync frame, control %x", + snprintf(strbuf, sizeof(strbuf), "Implementor sync frame, control %x", fc & FDDI_FC_ZZZZ); return strbuf; diff --git a/epan/dissectors/packet-flip.c b/epan/dissectors/packet-flip.c index 6d684a6e91..47a2464cb0 100644 --- a/epan/dissectors/packet-flip.c +++ b/epan/dissectors/packet-flip.c @@ -81,7 +81,7 @@ static gint ett_flip_payload = -1; static void flip_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode FLIP payload protocol as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode FLIP payload protocol as"); } /* Dissect the checksum extension header. */ diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 43427eaa0a..99303be481 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -838,7 +838,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* if (show_file_off) { proto_tree_add_int64_format_value(fh_tree, hf_frame_file_off, tvb, 0, 0, pinfo->fd->file_off, - "%" G_GINT64_MODIFIER "d (0x%" G_GINT64_MODIFIER "x)", + "%" PRId64 " (0x%" PRIx64 ")", pinfo->fd->file_off, pinfo->fd->file_off); } } diff --git a/epan/dissectors/packet-ftdi-mpsse.c b/epan/dissectors/packet-ftdi-mpsse.c index 83c866379f..e3f2b51404 100644 --- a/epan/dissectors/packet-ftdi-mpsse.c +++ b/epan/dissectors/packet-ftdi-mpsse.c @@ -1224,7 +1224,7 @@ dissect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offse expert_tree = proto_item_add_subtree(item, ett_mpsse_skipped_response_data); command_in = proto_tree_add_uint_format(expert_tree, hf_mpsse_command_in, NULL, 0, 0, cmd_data->command_in_packet, - "Bad Command 0x%02x in: %" G_GUINT32_FORMAT, cmd_data->cmd, cmd_data->command_in_packet); + "Bad Command 0x%02x in: %" PRIu32, cmd_data->cmd, cmd_data->command_in_packet); proto_item_set_generated(command_in); if (cmd_data->is_response_set) { @@ -1252,7 +1252,7 @@ dissect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offse rsp_tree = proto_item_add_subtree(rsp_data, ett_mpsse_response_data); command_in = proto_tree_add_uint_format(rsp_tree, hf_mpsse_command_in, NULL, 0, 0, cmd_data->command_in_packet, - "Command 0x%02x in: %" G_GUINT32_FORMAT, cmd_data->cmd, cmd_data->command_in_packet); + "Command 0x%02x in: %" PRIu32, cmd_data->cmd, cmd_data->command_in_packet); proto_item_set_generated(command_in); offset += dissect_response_data(tvb, pinfo, rsp_tree, offset, cmd_data); diff --git a/epan/dissectors/packet-geonw.c b/epan/dissectors/packet-geonw.c index 57c628a79e..211502ef03 100644 --- a/epan/dissectors/packet-geonw.c +++ b/epan/dissectors/packet-geonw.c @@ -1247,7 +1247,7 @@ dissect_sec_intx(tvbuff_t *tvb, gint *offset, packet_info *pinfo, proto_tree *tr proto_tree_add_bits_item(subtree, hf_sgeonw_var_len_det, tvb, start << 3, (*offset) - start, ENC_NA); if ((hf != hf_sgeonw_app_id) || ((*offset) - start) > 4) { proto_tree_add_uint64_bits_format_value(subtree, hf, tvb, (start << 3) + (*offset) - start, - (((*offset) - start) << 3) - ((*offset) - start), tmp_val, ENC_BIG_ENDIAN, "%" G_GUINT64_FORMAT, tmp_val); + (((*offset) - start) << 3) - ((*offset) - start), tmp_val, ENC_BIG_ENDIAN, "%" PRIu64, tmp_val); } else { proto_tree_add_uint_bits_format_value(subtree, hf, tvb, (start << 3) + (*offset) - start, @@ -2747,7 +2747,7 @@ btpa_src_prompt(packet_info *pinfo _U_, gchar* result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_srcport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW); } static gpointer @@ -2761,7 +2761,7 @@ btpa_dst_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_dstport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer @@ -2775,7 +2775,7 @@ btpa_both_prompt(packet_info *pinfo, gchar *result) { guint32 srcport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_srcport, pinfo->curr_layer_num)), destport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpa_dstport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); } static void @@ -2783,7 +2783,7 @@ btpb_dst_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_btpb_dstport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer @@ -2914,7 +2914,7 @@ proto_reg_handoff_btpb(void) static void display_latitude( gchar *result, gint32 hexver ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)", + snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)", abs(hexver)/10000000, abs(hexver%10000000)*6/1000000, abs(hexver*6%1000000)*6./100000., @@ -2925,7 +2925,7 @@ display_latitude( gchar *result, gint32 hexver ) static void display_longitude( gchar *result, gint32 hexver ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)", + snprintf( result, ITEM_LABEL_LENGTH, "%ud%u'%.2f\"%c (%d)", abs(hexver)/10000000, abs(hexver%10000000)*6/1000000, abs(hexver*6%1000000)*6./100000., @@ -2936,13 +2936,13 @@ display_longitude( gchar *result, gint32 hexver ) static void display_speed( gchar *result, gint32 hexver ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%.2f m/s", hexver/100.); + snprintf( result, ITEM_LABEL_LENGTH, "%.2f m/s", hexver/100.); } static void display_heading( gchar *result, guint32 hexver ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%.1f degrees", hexver/10.); + snprintf( result, ITEM_LABEL_LENGTH, "%.1f degrees", hexver/10.); } static void @@ -2954,9 +2954,9 @@ display_elevation( gchar *result, gint32 hexver ) // also represented by 0xF001. // 0xF000: an unknown elevation if (hexver == -4096) - g_snprintf( result, ITEM_LABEL_LENGTH, "Unknown (%4x)", hexver); + snprintf( result, ITEM_LABEL_LENGTH, "Unknown (%4x)", hexver); else - g_snprintf( result, ITEM_LABEL_LENGTH, "%.1fm", hexver/10.); + snprintf( result, ITEM_LABEL_LENGTH, "%.1fm", hexver/10.); } void diff --git a/epan/dissectors/packet-gfp.c b/epan/dissectors/packet-gfp.c index 84af2f48bf..4714c592fd 100644 --- a/epan/dissectors/packet-gfp.c +++ b/epan/dissectors/packet-gfp.c @@ -175,7 +175,7 @@ static const range_string gfp_upi_management_rvals[] = { static void gfp_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "UPI %u as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "UPI %u as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_gfp, 0))); } diff --git a/epan/dissectors/packet-glusterfs.c b/epan/dissectors/packet-glusterfs.c index 9b784b8de6..54fd7b4580 100644 --- a/epan/dissectors/packet-glusterfs.c +++ b/epan/dissectors/packet-glusterfs.c @@ -690,12 +690,12 @@ gluster_rpc4_0_dissect_dict(proto_tree *tree, tvbuff_t *tvb, int hfindex, int of if (val_type == 2) { val_len = 8; dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len, - NULL, "%s: %"G_GINT64_FORMAT, key, + NULL, "%s: %"PRId64, key, tvb_get_gint64(tvb, offset, ENC_BIG_ENDIAN)); } else if (val_type == 3) { val_len = 8; dict_item = proto_tree_add_string_format(subtree, hf_gluster_dict_value, tvb, offset, val_len, - NULL, "%s: %"G_GUINT64_FORMAT, key, + NULL, "%s: %"PRIu64, key, tvb_get_guint64(tvb, offset, ENC_BIG_ENDIAN)); } else if (val_type == 4) { val_len = 8; diff --git a/epan/dissectors/packet-gmr1_bcch.c b/epan/dissectors/packet-gmr1_bcch.c index 848610fe7b..c1229c2354 100644 --- a/epan/dissectors/packet-gmr1_bcch.c +++ b/epan/dissectors/packet-gmr1_bcch.c @@ -951,7 +951,7 @@ CSN_DESCR_END (SystemInformation2_t) static void segx_half_db_value_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%2.1f dB (%u)", v * 0.5f, v); + snprintf(s, ITEM_LABEL_LENGTH, "%2.1f dB (%u)", v * 0.5f, v); } /* Segment 1A - [3] 11.5.2.66 */ @@ -959,7 +959,7 @@ static void seg1a_syncinfo_sa_freq_offset_fmt(gchar *s, guint32 v) { gint32 sv = (gint32)v; - g_snprintf(s, ITEM_LABEL_LENGTH, "%d Hz (%d)", sv * 5, sv); + snprintf(s, ITEM_LABEL_LENGTH, "%d Hz (%d)", sv * 5, sv); } static const value_string seg1a_rachctrl_acc_vals[] = { @@ -1000,7 +1000,7 @@ seg3a_latitude_fmt(gchar *s, guint32 v) } else c = 'N'; - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%d)", sv / 10.0f, c, sv); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%d)", sv / 10.0f, c, sv); } static void @@ -1017,7 +1017,7 @@ seg3a_longitude_fmt(gchar *s, guint32 v) sv = 3600 - v; } - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%u)", sv / 10.0f, c, v); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f %c (%u)", sv / 10.0f, c, v); } static void @@ -1025,13 +1025,13 @@ seg3a_satpos_radius_fmt(gchar *s, guint32 v) { gint32 sv = (gint32)v; gint32 a = (42162 * 1000) + (sv * 5); - g_snprintf(s, ITEM_LABEL_LENGTH, "%.3lf km (%u)", a / 1000.0, sv); + snprintf(s, ITEM_LABEL_LENGTH, "%.3lf km (%u)", a / 1000.0, sv); } static void seg3a_miscinfo_sb_reselection_timer_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%u)", v*4, v); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%u)", v*4, v); } /* System Information 1 - [1] 10.3.31 */ diff --git a/epan/dissectors/packet-gmr1_rach.c b/epan/dissectors/packet-gmr1_rach.c index 3347d5c158..5d0dff10c9 100644 --- a/epan/dissectors/packet-gmr1_rach.c +++ b/epan/dissectors/packet-gmr1_rach.c @@ -244,7 +244,7 @@ rach_gps_pos_lat_fmt(gchar *s, guint32 v) { gint32 sv = v; - g_snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)", + snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)", abs(sv) / 2912.7f, sv < 0 ? "S" : "N", sv); } @@ -253,7 +253,7 @@ rach_gps_pos_long_fmt(gchar *s, guint32 v) { gint32 sv = v; - g_snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)", + snprintf(s, ITEM_LABEL_LENGTH, "%.5f %s (%d)", abs(sv) / 2912.70555f, sv < 0 ? "W" : "E", sv); /* FIXME: The specs says >0 is West ... but it doesn't seem to @@ -302,11 +302,11 @@ static void rach_sp_hplmn_id_fmt(gchar *s, guint32 v) { if (v == 0xfffff) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%05x (Null)", v); + snprintf(s, ITEM_LABEL_LENGTH, "%05x (Null)", v); } else if ((v & 0xf8000) == 0xf8000) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%05x (SP ID %4d)", v, v & 0x7fff); + snprintf(s, ITEM_LABEL_LENGTH, "%05x (SP ID %4d)", v, v & 0x7fff); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%05x (HPLMN ID)", v); + snprintf(s, ITEM_LABEL_LENGTH, "%05x (HPLMN ID)", v); } } @@ -322,20 +322,20 @@ static void rach_dialed_num_grp1234_fmt(gchar *s, guint32 v) { if (v <= 999) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%03d", v); + snprintf(s, ITEM_LABEL_LENGTH, "%03d", v); } else if (v == 1023) { - g_snprintf(s, ITEM_LABEL_LENGTH, + snprintf(s, ITEM_LABEL_LENGTH, "All digits in the preceding group are valid (%d)", v); } else if (v == 1022) { - g_snprintf(s, ITEM_LABEL_LENGTH, + snprintf(s, ITEM_LABEL_LENGTH, "First two digits in the preceding group are valid, " "and the third digit (i.e. 0) is padding (%d)", v); } else if (v == 1021) { - g_snprintf(s, ITEM_LABEL_LENGTH, + snprintf(s, ITEM_LABEL_LENGTH, "First digit in the preceding group is valid, and " "the second and third 0s are padding (%d)", v); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid (%d)", v); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid (%d)", v); } } @@ -343,9 +343,9 @@ static void rach_dialed_num_grp5_fmt(gchar *s, guint32 v) { if (v >= 1100 && v <= 1199) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%02d (%d)", v - 1100, v); + snprintf(s, ITEM_LABEL_LENGTH, "%02d (%d)", v - 1100, v); } else if (v >= 1200 && v <= 1209) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%01d (%d)", v - 1200, v); + snprintf(s, ITEM_LABEL_LENGTH, "%01d (%d)", v - 1200, v); } else { rach_dialed_num_grp1234_fmt(s, v); } @@ -355,9 +355,9 @@ static void rach_gps_timestamp_fmt(gchar *s, guint32 v) { if (v == 0xffff) { - g_snprintf(s, ITEM_LABEL_LENGTH, ">= 65535 minutes or N/A (%04x)", v); + snprintf(s, ITEM_LABEL_LENGTH, ">= 65535 minutes or N/A (%04x)", v); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%04x)", v, v); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (%04x)", v, v); } } @@ -475,38 +475,38 @@ _parse_dialed_number(gchar *s, int slen, tvbuff_t *tvb, int offset) if (grp[i+1] <= 999) { /* All digits of group are valid */ - rv += g_snprintf(s + rv, slen - rv, "%03d", grp[i]); + rv += snprintf(s + rv, slen - rv, "%03d", grp[i]); } else if (grp[i+1] == 1023) { /* Last group and all digits are valid */ - rv += g_snprintf(s + rv, slen - rv, "%03d", grp[i]); + rv += snprintf(s + rv, slen - rv, "%03d", grp[i]); done = 1; break; } else if (grp[i+1] == 1022) { /* Last group and first two digits are valid */ - rv += g_snprintf(s + rv, slen - rv, "%02d", grp[i] / 10); + rv += snprintf(s + rv, slen - rv, "%02d", grp[i] / 10); done = 1; break; } else if (grp[i+1] == 1021) { /* Last group and first digit is valid */ - rv += g_snprintf(s + rv, slen - rv, "%01d", grp[i] / 100); + rv += snprintf(s + rv, slen - rv, "%01d", grp[i] / 100); done = 1; break; } else if ((i==3) && (grp[i+1] >= 1100) && (grp[i+1] <= 1209)) { /* All digits of group are valid */ - rv += g_snprintf(s + rv, slen - rv, "%03d", grp[i]); + rv += snprintf(s + rv, slen - rv, "%03d", grp[i]); } else { /* Invalid */ - return g_snprintf(s, slen, "(Invalid)"); + return snprintf(s, slen, "(Invalid)"); } } @@ -514,22 +514,22 @@ _parse_dialed_number(gchar *s, int slen, tvbuff_t *tvb, int offset) if (grp[4] <= 999) { /* All digits are valid */ - rv += g_snprintf(s + rv, slen - rv, "%03d", grp[4]); + rv += snprintf(s + rv, slen - rv, "%03d", grp[4]); } else if (grp[4] >= 1100 && grp[4] <= 1199) { /* Only two digits are valid */ - rv += g_snprintf(s + rv, slen - rv, "%02d", grp[4] - 1100); + rv += snprintf(s + rv, slen - rv, "%02d", grp[4] - 1100); } else if (grp[4] >= 1200 && grp[4] <= 1209) { /* Only one digit is valid */ - rv += g_snprintf(s + rv, slen - rv, "%01d", grp[4] - 1200); + rv += snprintf(s + rv, slen - rv, "%01d", grp[4] - 1200); } else { /* Invalid */ - return g_snprintf(s, slen, "(Invalid)"); + return snprintf(s, slen, "(Invalid)"); } } diff --git a/epan/dissectors/packet-gmr1_rr.c b/epan/dissectors/packet-gmr1_rr.c index 14130a84d2..2ddf0382cc 100644 --- a/epan/dissectors/packet-gmr1_rr.c +++ b/epan/dissectors/packet-gmr1_rr.c @@ -262,7 +262,7 @@ static const value_string rr_gen_ie_presence_vals[] = { static void rr_gen_ie_seconds_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%u seconds", v); + snprintf(s, ITEM_LABEL_LENGTH, "%u seconds", v); } @@ -477,7 +477,7 @@ rr_timing_ofs_value_fmt(gchar *s, guint32 v) { gint32 sv = (signed)v; - g_snprintf(s, ITEM_LABEL_LENGTH, "%.3f symbols ( ~ %.3f ms )", + snprintf(s, ITEM_LABEL_LENGTH, "%.3f symbols ( ~ %.3f ms )", sv / 40.0f, (sv / 40.0f) * (10.0f / 234.0f)); } @@ -577,7 +577,7 @@ rr_freq_ofs_value_fmt(gchar *s, guint32 v) { gint32 sv = (signed)v; - g_snprintf(s, ITEM_LABEL_LENGTH, "%d Hz", sv); + snprintf(s, ITEM_LABEL_LENGTH, "%d Hz", sv); } GMR1_IE_FUNC(gmr1_ie_rr_freq_ofs) @@ -674,13 +674,13 @@ static const value_string rr_pos_upd_info_v_vals[] = { static void rr_pos_upd_info_dist_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d km", v); + snprintf(s, ITEM_LABEL_LENGTH, "%d km", v); } static void rr_pos_upd_info_time_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v); } GMR1_IE_FUNC(gmr1_ie_rr_pos_upd_info) @@ -775,9 +775,9 @@ static void rr_gps_timestamp_fmt(gchar *s, guint32 v) { if (v == 0xffff) - g_snprintf(s, ITEM_LABEL_LENGTH, "> 65535 minutes or N/A"); + snprintf(s, ITEM_LABEL_LENGTH, "> 65535 minutes or N/A"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", v); } GMR1_IE_FUNC(gmr1_ie_rr_gps_timestamp) @@ -816,7 +816,7 @@ GMR1_IE_FUNC(gmr1_ie_rr_tmsi_avail_msk) static void rr_gps_almanac_pn_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d", v+1); + snprintf(s, ITEM_LABEL_LENGTH, "%d", v+1); } static const value_string rr_gps_almanac_sfn_vals[] = { @@ -940,7 +940,7 @@ static const crumb_spec_t rr_pkt_freq_prm_ul_freq_dist_crumbs[] = { static void rr_pkt_freq_prm_xx_bw_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d * 31.25 kHz = %.2f kHz (%d)", v, 31.25f*v, v); + snprintf(s, ITEM_LABEL_LENGTH, "%d * 31.25 kHz = %.2f kHz (%d)", v, 31.25f*v, v); } GMR1_IE_FUNC(gmr1_ie_rr_pkt_freq_prm) @@ -1135,11 +1135,11 @@ static void rr_pkt_pwr_ctrl_prm_par_fmt(gchar *s, guint32 v) { if (v >= 61) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Escape %d (%d)", v-60, v); + snprintf(s, ITEM_LABEL_LENGTH, "Escape %d (%d)", v-60, v); return; } - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f dB (%d)", v*0.4f, v); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f dB (%d)", v*0.4f, v); } GMR1_IE_FUNC(gmr1_ie_rr_pkt_pwr_ctrl_prm) diff --git a/epan/dissectors/packet-gquic.c b/epan/dissectors/packet-gquic.c index c9e1be6306..611dfa2c99 100644 --- a/epan/dissectors/packet-gquic.c +++ b/epan/dissectors/packet-gquic.c @@ -2224,7 +2224,7 @@ dissect_gquic_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item(gquic_tree, hf_gquic_version, tvb, offset, 4, ENC_ASCII|ENC_NA); offset += 4; } - col_add_fstr(pinfo->cinfo, COL_INFO, "Version Negotiation, CID: %" G_GINT64_MODIFIER "u", cid); + col_add_fstr(pinfo->cinfo, COL_INFO, "Version Negotiation, CID: %" PRIu64, cid); return offset; } else{ @@ -2251,7 +2251,7 @@ dissect_gquic_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset = dissect_gquic_tag(tvb, pinfo, gquic_tree, offset, tag_number); - col_add_fstr(pinfo->cinfo, COL_INFO, "Public Reset, CID: %" G_GINT64_MODIFIER "u", cid); + col_add_fstr(pinfo->cinfo, COL_INFO, "Public Reset, CID: %" PRIu64, cid); return offset; } @@ -2280,10 +2280,10 @@ dissect_gquic_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } - col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" G_GINT64_MODIFIER "u", pkn); + col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" PRIu64, pkn); if(cid){ - col_append_fstr(pinfo->cinfo, COL_INFO, ", CID: %" G_GINT64_MODIFIER "u", cid); + col_append_fstr(pinfo->cinfo, COL_INFO, ", CID: %" PRIu64, cid); } @@ -2399,10 +2399,10 @@ dissect_gquic_q046(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } - col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" G_GINT64_MODIFIER "u", pkn); + col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" PRIu64, pkn); if(cid){ - col_append_fstr(pinfo->cinfo, COL_INFO, ", CID: %" G_GINT64_MODIFIER "u", cid); + col_append_fstr(pinfo->cinfo, COL_INFO, ", CID: %" PRIu64, cid); } return offset; diff --git a/epan/dissectors/packet-gsm_a_bssmap.c b/epan/dissectors/packet-gsm_a_bssmap.c index 5c99239716..9c703c6f4b 100644 --- a/epan/dissectors/packet-gsm_a_bssmap.c +++ b/epan/dissectors/packet-gsm_a_bssmap.c @@ -1087,7 +1087,7 @@ be_cic(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, curr_offset += 2; if (add_string) - g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value); + snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value); /* no length check possible */ @@ -1246,7 +1246,7 @@ bssmap_dissect_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint3 curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (National Cause)"); + snprintf(add_string, string_len, " - (National Cause)"); } else { @@ -1262,7 +1262,7 @@ bssmap_dissect_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint3 curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, + snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, rval_to_str_const(oct & 0x7f, gsm_a_bssap_cause_rvals, "Unknown")); } @@ -1295,7 +1295,7 @@ be_tmsi(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, gui value); if (add_string) - g_snprintf(add_string, string_len, " - (0x%04x)", value); + snprintf(add_string, string_len, " - (0x%04x)", value); curr_offset += 4; @@ -1454,7 +1454,7 @@ be_chan_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset proto_tree_add_item(tree, hf_gsm_a_bssmap_speech_data_ind, tvb, curr_offset, 1, ENC_BIG_ENDIAN); if (add_string) - g_snprintf(add_string, string_len, " - (%s)", val_to_str_const(tvb_get_guint8(tvb, curr_offset) & 0x0f, + snprintf(add_string, string_len, " - (%s)", val_to_str_const(tvb_get_guint8(tvb, curr_offset) & 0x0f, gsm_a_bssap_speech_data_ind_vals, "Unknown")); @@ -1810,7 +1810,7 @@ be_cell_id_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off curr_offset += 2; if (add_string) - g_snprintf(add_string, string_len, " - LAC (0x%04x)", value); + snprintf(add_string, string_len, " - LAC (0x%04x)", value); if (disc == 0x0b) { /* If SAI, SAC follows */ proto_tree_add_item(tree, hf_gsm_a_bssmap_sac, tvb, curr_offset, 2, ENC_BIG_ENDIAN); @@ -1835,11 +1835,11 @@ be_cell_id_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off { if (add_string[0] == '\0') { - g_snprintf(add_string, string_len, " - RNC-ID (%u)", value); + snprintf(add_string, string_len, " - RNC-ID (%u)", value); } else { - g_snprintf(add_string, string_len, "%s/RNC-ID (%u)", add_string, value); + snprintf(add_string, string_len, "%s/RNC-ID (%u)", add_string, value); } } break; @@ -1862,11 +1862,11 @@ be_cell_id_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off { if (add_string[0] == '\0') { - g_snprintf(add_string, string_len, " - CI (%u)", value); + snprintf(add_string, string_len, " - CI (%u)", value); } else { - g_snprintf(add_string, string_len, "%s/CI (%u)", add_string, value); + snprintf(add_string, string_len, "%s/CI (%u)", add_string, value); } } break; @@ -1948,7 +1948,7 @@ be_prio(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offset, proto_tree_add_item(tree, hf_gsm_a_bssmap_priority_level, tvb, curr_offset, 1, ENC_NA); if (add_string) - g_snprintf(add_string, string_len, " - (%u)", (oct & 0x3c) >> 2); + snprintf(add_string, string_len, " - (%u)", (oct & 0x3c) >> 2); proto_tree_add_item(tree, hf_gsm_a_bssmap_qa, tvb, curr_offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_gsm_a_bssmap_pvi, tvb, curr_offset, 1, ENC_BIG_ENDIAN); @@ -2199,7 +2199,7 @@ be_cell_id_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off while ((len - (curr_offset - offset)) > 0 && consumed > 0); if (add_string) { - g_snprintf(add_string, string_len, " - %u cell%s", + snprintf(add_string, string_len, " - %u cell%s", num_cells, plurality(num_cells, "", "s")); } @@ -2713,7 +2713,7 @@ be_chosen_enc_alg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - %s", val_to_str_const(oct, gsm_a_bssmap_algorithm_id_vals, "Unknown")); + snprintf(add_string, string_len, " - %s", val_to_str_const(oct, gsm_a_bssmap_algorithm_id_vals, "Unknown")); /* no length check possible */ @@ -2751,7 +2751,7 @@ be_cct_pool(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (%u)", oct); + snprintf(add_string, string_len, " - (%u)", oct); /* no length check possible */ @@ -2864,7 +2864,7 @@ be_speech_ver(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 o curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (%s)", rval_to_str_const(oct & 0x7f, speech_version_id_short_rvals, "Reserved")); + snprintf(add_string, string_len, " - (%s)", rval_to_str_const(oct & 0x7f, speech_version_id_short_rvals, "Reserved")); /* no length check possible */ diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c index 18da413836..a4d9bf0ae5 100644 --- a/epan/dissectors/packet-gsm_a_common.c +++ b/epan/dissectors/packet-gsm_a_common.c @@ -2303,7 +2303,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin proto_tree_add_item(tree, hf_gsm_a_mobile_identity_type, tvb, curr_offset, 1, ENC_BIG_ENDIAN); if (add_string) - g_snprintf(add_string, string_len, " - No Identity Code"); + snprintf(add_string, string_len, " - No Identity Code"); curr_offset++; @@ -2347,7 +2347,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin } if (add_string) - g_snprintf(add_string, string_len, " - %s (%s)", + snprintf(add_string, string_len, " - %s (%s)", ((oct & 0x07) == 3) ? "IMEISV" : "IMSI", digit_str); @@ -2379,7 +2379,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin digit_str); if (add_string) - g_snprintf(add_string, string_len, " - IMEI (%s)", digit_str); + snprintf(add_string, string_len, " - IMEI (%s)", digit_str); curr_offset += len - (curr_offset - offset); break; @@ -2393,7 +2393,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin proto_tree_add_item_ret_uint(tree, hf_3gpp_tmsi, tvb, curr_offset, 4, ENC_BIG_ENDIAN, &value); if (add_string) - g_snprintf(add_string, string_len, " - TMSI/P-TMSI (0x%04x)", value); + snprintf(add_string, string_len, " - TMSI/P-TMSI (0x%04x)", value); curr_offset += 4; break; @@ -2435,7 +2435,7 @@ de_mid(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guin expert_add_info_format(pinfo, ti, &ei_gsm_a_mobile_identity_type, "Unknown format %u", (oct & 0x07)); if (add_string) - g_snprintf(add_string, string_len, " - Format Unknown"); + snprintf(add_string, string_len, " - Format Unknown"); curr_offset += len; break; @@ -3574,7 +3574,7 @@ de_plmn_list(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset } if (add_string) - g_snprintf(add_string, string_len, " - %u PLMN%s", + snprintf(add_string, string_len, " - %u PLMN%s", num_plmn, plurality(num_plmn, "", "s")); EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_extraneous_data); diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index ef2113072a..f4f9f10e1a 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -1695,7 +1695,7 @@ de_bearer_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offse proto_tree_add_item(subtree, hf_gsm_a_dtap_itc, tvb, curr_offset, 1, ENC_BIG_ENDIAN); if (add_string) - g_snprintf(add_string, string_len, " - (%s)", str); + snprintf(add_string, string_len, " - (%s)", str); curr_offset++; @@ -2372,7 +2372,7 @@ de_cld_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint3 } if (add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); } return (len); @@ -2389,7 +2389,7 @@ de_cld_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr); if (extr_addr && add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); return (len); } @@ -2405,7 +2405,7 @@ de_clg_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint3 de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_clg_party_bcd_num, &extr_addr); if (extr_addr && add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); return (len); } @@ -2421,7 +2421,7 @@ de_clg_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr); if (extr_addr && add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); return (len); } @@ -2557,7 +2557,7 @@ de_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, gu curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (%u) %s", cause, str); + snprintf(add_string, string_len, " - (%u) %s", cause, str); NO_MORE_DATA_CHECK(len); @@ -2616,7 +2616,7 @@ de_conn_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_conn_num, &extr_addr); if (extr_addr && add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); return (len); } @@ -2632,7 +2632,7 @@ de_conn_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr); if (extr_addr && add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); return (len); } @@ -2722,7 +2722,7 @@ de_keypad_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - %c", keypad_char); + snprintf(add_string, string_len, " - %c", keypad_char); /* no length check possible */ @@ -2869,7 +2869,7 @@ de_red_party_bcd_num(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint3 de_bcd_num(tvb, tree, pinfo, offset, len, hf_gsm_a_dtap_red_party_bcd_num, &extr_addr); if (extr_addr && add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); return (len); } @@ -2885,7 +2885,7 @@ de_red_party_sub_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint de_sub_addr(tvb, tree, pinfo, offset, len, &extr_addr); if (extr_addr && add_string) - g_snprintf(add_string, string_len, " - (%s)", extr_addr); + snprintf(add_string, string_len, " - (%s)", extr_addr); return (len); } @@ -3126,14 +3126,14 @@ de_stream_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset "No Bearer (%u)", oct); if (add_string) - g_snprintf(add_string, string_len, " - (No Bearer)"); + snprintf(add_string, string_len, " - (No Bearer)"); } else { proto_tree_add_item(tree, hf_gsm_a_dtap_stream_identifier, tvb, curr_offset, 1, ENC_BIG_ENDIAN); if (add_string) - g_snprintf(add_string, string_len, " - (%u)", oct); + snprintf(add_string, string_len, " - (%u)", oct); } curr_offset++; @@ -3194,7 +3194,7 @@ de_ca_of_no_cli(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 off curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (%s)", val_to_str_const(oct, gsm_a_cause_of_no_cli_values, "Unavailable")); + snprintf(add_string, string_len, " - (%s)", val_to_str_const(oct, gsm_a_cause_of_no_cli_values, "Unavailable")); EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_dtap_extraneous_data); @@ -3412,7 +3412,7 @@ de_cp_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (%u) %s", oct, str); + snprintf(add_string, string_len, " - (%u) %s", oct, str); /* no length check possible */ diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c index 5c023b1ad3..975a1be3a3 100644 --- a/epan/dissectors/packet-gsm_a_gm.c +++ b/epan/dissectors/packet-gsm_a_gm.c @@ -1584,10 +1584,10 @@ static void gsm_a_gm_dlmc_max_nb_dl_ts_fmt(gchar *s, guint32 v) { if (v < 0x3E) - g_snprintf(s, ITEM_LABEL_LENGTH, "%u TS supported (%u)", + snprintf(s, ITEM_LABEL_LENGTH, "%u TS supported (%u)", 2*v + 6, v); else - g_snprintf(s, ITEM_LABEL_LENGTH, "Reserved (%u)", v); + snprintf(s, ITEM_LABEL_LENGTH, "Reserved (%u)", v); } static const value_string gsm_a_gm_dlmc_max_nb_dl_carriers_vals[] = { @@ -3509,7 +3509,7 @@ de_gmm_rai(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, { if (add_string[0] == '\0') { - g_snprintf(add_string, string_len, " - RAI: %x-%x-%u-%u", mcc, mnc, lac, rac); + snprintf(add_string, string_len, " - RAI: %x-%x-%u-%u", mcc, mnc, lac, rac); } } @@ -5759,7 +5759,7 @@ de_sm_pflow_id(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offs curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - %s", rval_to_str(value, gsm_a_sm_packet_flow_id_vals, "Unknown")); + snprintf(add_string, string_len, " - %s", rval_to_str(value, gsm_a_sm_packet_flow_id_vals, "Unknown")); EXTRANEOUS_DATA_CHECK(len, curr_offset - offset, pinfo, &ei_gsm_a_gm_extraneous_data); diff --git a/epan/dissectors/packet-gsm_a_rp.c b/epan/dissectors/packet-gsm_a_rp.c index 700d32996a..4f51227abd 100644 --- a/epan/dissectors/packet-gsm_a_rp.c +++ b/epan/dissectors/packet-gsm_a_rp.c @@ -205,7 +205,7 @@ de_rp_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 off curr_offset++; if (add_string) - g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, val_to_str_ext_const(oct & 0x7f, &gsm_rp_cause_vals_ext, "Reserved")); + snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, val_to_str_ext_const(oct & 0x7f, &gsm_rp_cause_vals_ext, "Reserved")); NO_MORE_DATA_CHECK(len); diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c index 42776ce3e3..74d2a3d58b 100644 --- a/epan/dissectors/packet-gsm_a_rr.c +++ b/epan/dissectors/packet-gsm_a_rr.c @@ -8640,7 +8640,7 @@ de_rr_tlli(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 offs curr_offset = curr_offset + 4; if(add_string) - g_snprintf(add_string, string_len, " - 0x%x", tlli); + snprintf(add_string, string_len, " - 0x%x", tlli); return(curr_offset - offset); } @@ -9073,7 +9073,7 @@ de_rr_ec_request_reference(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _ static void gsm_a_rr_ec_ma_number_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "EC-EGPRS Mobile Allocation set %u (%u)", v+1, v); + snprintf(s, ITEM_LABEL_LENGTH, "EC-EGPRS Mobile Allocation set %u (%u)", v+1, v); } static guint16 diff --git a/epan/dissectors/packet-gsm_abis_oml.c b/epan/dissectors/packet-gsm_abis_oml.c index edad5b3dd6..c4d79394fe 100644 --- a/epan/dissectors/packet-gsm_abis_oml.c +++ b/epan/dissectors/packet-gsm_abis_oml.c @@ -1204,10 +1204,10 @@ static void format_custom_msgtype(gchar *out, guint32 in) } if (tmp) - g_snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp); + snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp); else { tmp_str = val_to_str_wmem(NULL, in, oml_fom_msgtype_vals, "Unknown 0x%02x"); - g_snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp_str); + snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp_str); wmem_free(NULL, tmp_str); } } @@ -1231,10 +1231,10 @@ static void format_custom_attr(gchar *out, guint32 in) } if (tmp) - g_snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp); + snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp); else { tmp_str = val_to_str_wmem(NULL, in, oml_fom_attr_vals, "Unknown 0x%02x"); - g_snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp_str); + snprintf(out, ITEM_LABEL_LENGTH, "%s", tmp_str); wmem_free(NULL, tmp_str); } } @@ -1242,7 +1242,7 @@ static void format_custom_attr(gchar *out, guint32 in) /* Interference level boundaries are coded as a binary presentation of -x dBm */ static void format_interf_bound(gchar *buf, const guint32 in) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "-%u%s", in, + snprintf(buf, ITEM_LABEL_LENGTH, "-%u%s", in, unit_name_string_get_value(in, &units_dbm)); } diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c index 9953166cc4..1a8beba704 100644 --- a/epan/dissectors/packet-gtpv2.c +++ b/epan/dissectors/packet-gtpv2.c @@ -1547,7 +1547,7 @@ gtpv2_sn_equal_unmatched(gconstpointer k1, gconstpointer k2) static void value_in_tenth_of_percent_fmt(gchar* s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f%% (%u)", (float)v / 10, v); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f%% (%u)", (float)v / 10, v); } @@ -3217,7 +3217,7 @@ dissect_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gchar **av offset += 3; proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id); *avp_str = wmem_strdup_printf(pinfo->pool, - "%s, NR Cell Id 0x%" G_GINT64_MODIFIER "x", + "%s, NR Cell Id 0x%" PRIx64, mcc_mnc_str, nr_cell_id); } return length; @@ -3247,7 +3247,7 @@ dissect_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gchar **av offset += 3; proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id); *avp_str = wmem_strdup_printf(pinfo->pool, - "%s, %s, NR Cell Id 0x%" G_GINT64_MODIFIER "x", + "%s, %s, NR Cell Id 0x%" PRIx64, *avp_str, mcc_mnc_str, nr_cell_id); } return length; @@ -6591,7 +6591,7 @@ dissect_gtpv2_tmgi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, prot tmgi = tvb_get_ntoh48(tvb, offset); - proto_item_append_text(item, "%012" G_GINT64_MODIFIER "x", tmgi); + proto_item_append_text(item, "%012" PRIx64, tmgi); proto_tree_add_item(tree, hf_gtpv2_mbms_service_id, tvb, offset, 3, ENC_NA); offset += 3; diff --git a/epan/dissectors/packet-gvcp.c b/epan/dissectors/packet-gvcp.c index a7c13684f0..c84ef3f18e 100644 --- a/epan/dissectors/packet-gvcp.c +++ b/epan/dissectors/packet-gvcp.c @@ -1586,7 +1586,7 @@ static void dissect_packetresend_cmd(proto_tree *gvcp_telegram_tree, tvbuff_t *t last_packet = tvb_get_ntohl(tvb, offset + 8); } - col_append_fstr(pinfo->cinfo, COL_INFO, "Block %" G_GINT64_MODIFIER "u, Packets %d->%d", (gint64)block_id, first_packet, last_packet); + col_append_fstr(pinfo->cinfo, COL_INFO, "Block %" PRIu64 ", Packets %d->%d", (gint64)block_id, first_packet, last_packet); if (gvcp_telegram_tree != NULL) { diff --git a/epan/dissectors/packet-gvsp.c b/epan/dissectors/packet-gvsp.c index ec91ae549c..dc8dd38678 100644 --- a/epan/dissectors/packet-gvsp.c +++ b/epan/dissectors/packet-gvsp.c @@ -2454,7 +2454,7 @@ static int dissect_gvsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi /* At this point offset is pointing to end of packet */ - col_append_fstr(pinfo->cinfo, COL_INFO, "[Block ID: %" G_GINT64_MODIFIER "u Packet ID: %d] ", (guint64)info.blockid, info.packetid); + col_append_fstr(pinfo->cinfo, COL_INFO, "[Block ID: %" PRIu64 " Packet ID: %d] ", (guint64)info.blockid, info.packetid); if (info.flag_resendrangeerror != 0) { diff --git a/epan/dissectors/packet-h264.c b/epan/dissectors/packet-h264.c index 8476570e63..59e873eee9 100644 --- a/epan/dissectors/packet-h264.c +++ b/epan/dissectors/packet-h264.c @@ -755,11 +755,11 @@ dissect_h264_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint *start_bit_offset = bit_offset; /* We will probably get a BoundsError later in the packet. */ if (descriptor == H264_SE_V) { - ti = proto_tree_add_int_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" G_GINT32_MODIFIER "d", leading_zero_bits, se_value); + ti = proto_tree_add_int_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" PRId32, leading_zero_bits, se_value); expert_add_info(NULL, ti, &ei_h264_oversized_exp_golomb_code); return se_value; } else { - ti = proto_tree_add_uint_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" G_GINT32_MODIFIER "u", leading_zero_bits, codenum); + ti = proto_tree_add_uint_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" PRIu32, leading_zero_bits, codenum); expert_add_info(NULL, ti, &ei_h264_oversized_exp_golomb_code); return codenum; } diff --git a/epan/dissectors/packet-h265.c b/epan/dissectors/packet-h265.c index d1118417e6..9a5142044c 100644 --- a/epan/dissectors/packet-h265.c +++ b/epan/dissectors/packet-h265.c @@ -997,11 +997,11 @@ dissect_h265_exp_golomb_code(proto_tree *tree, int hf_index, tvbuff_t *tvb, pack *start_bit_offset = bit_offset; /* We will probably get a BoundsError later in the packet. */ if (descriptor == H265_SE_V) { - ti = proto_tree_add_int_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" G_GINT32_MODIFIER "d", leading_zero_bits, se_value); + ti = proto_tree_add_int_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" PRId32, leading_zero_bits, se_value); expert_add_info(NULL, ti, &ei_h265_oversized_exp_golomb_code); return se_value; } else { - ti = proto_tree_add_uint_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" G_GINT32_MODIFIER "u", leading_zero_bits, codenum); + ti = proto_tree_add_uint_format_value(tree, hf_index, tvb, start_offset, (bit_offset >> 3) - start_offset + 1, codenum, "Invalid value (%d leading zero bits), clamped to %" PRIu32, leading_zero_bits, codenum); expert_add_info(NULL, ti, &ei_h265_oversized_exp_golomb_code); return codenum; } diff --git a/epan/dissectors/packet-hdcp.c b/epan/dissectors/packet-hdcp.c index 33982d7df0..cb8614c3fe 100644 --- a/epan/dissectors/packet-hdcp.c +++ b/epan/dissectors/packet-hdcp.c @@ -145,7 +145,7 @@ dissect_hdcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ ptvcursor_current_offset(cursor)); proto_tree_add_uint64_format(hdcp_tree, hf_hdcp_a_ksv, tvb, ptvcursor_current_offset(cursor), 5, - a_ksv, "A_ksv 0x%010" G_GINT64_MODIFIER "x", a_ksv); + a_ksv, "A_ksv 0x%010" PRIx64, a_ksv); ptvcursor_advance(cursor, 5); break; case REG_AN: @@ -185,7 +185,7 @@ dissect_hdcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ ptvcursor_current_offset(cursor)); proto_tree_add_uint64_format(hdcp_tree, hf_hdcp_b_ksv, tvb, ptvcursor_current_offset(cursor), 5, - b_ksv, "B_ksv 0x%010" G_GINT64_MODIFIER "x", + b_ksv, "B_ksv 0x%010" PRIx64, b_ksv); ptvcursor_advance(cursor, 5); break; diff --git a/epan/dissectors/packet-hdmi.c b/epan/dissectors/packet-hdmi.c index 7008d15151..5574dce99a 100644 --- a/epan/dissectors/packet-hdmi.c +++ b/epan/dissectors/packet-hdmi.c @@ -196,7 +196,7 @@ dissect_hdmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ static void hdmi_fmt_edid_version( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } void diff --git a/epan/dissectors/packet-homeplug-av.c b/epan/dissectors/packet-homeplug-av.c index b4968fcaf1..b87e43327d 100644 --- a/epan/dissectors/packet-homeplug-av.c +++ b/epan/dissectors/packet-homeplug-av.c @@ -2387,7 +2387,7 @@ static const value_string homeplug_av_st_iotecha_suppress_data_vals[] = { static void adc_bitmask_base(gchar *buf, guint8 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%s, %s, %s (%d)", + snprintf(buf, ITEM_LABEL_LENGTH, "%s, %s, %s (%d)", (value & 0x01) ? "true" : "false", (value & 0x02) ? "true" : "false", (value & 0x04) ? "true" : "false", diff --git a/epan/dissectors/packet-homeplug.c b/epan/dissectors/packet-homeplug.c index 9345add71c..4e129f66a0 100644 --- a/epan/dissectors/packet-homeplug.c +++ b/epan/dissectors/packet-homeplug.c @@ -1337,7 +1337,7 @@ dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* d static void homeplug_fmt_mhz( gchar *result, guint32 ns_bytes40 ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%.3f", (float)(ns_bytes40)/42); + snprintf( result, ITEM_LABEL_LENGTH, "%.3f", (float)(ns_bytes40)/42); } void diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 913ab2f76a..a1fd8c6ee6 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -637,7 +637,7 @@ http_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* e tick_stat_node(st, resp_str, st_node_responses, FALSE); - g_snprintf(str, sizeof(str), "%u %s", i, + snprintf(str, sizeof(str), "%u %s", i, val_to_str(i, vals_http_status_code, "Unknown (%d)")); tick_stat_node(st, str, resp_grp, FALSE); } else if (v->request_method) { diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c index 69c1484501..a57cec0791 100644 --- a/epan/dissectors/packet-http2.c +++ b/epan/dissectors/packet-http2.c @@ -288,7 +288,7 @@ static void http2_streamid_prompt(packet_info* pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "stream (%u)", http2_get_stream_id(pinfo)); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "stream (%u)", http2_get_stream_id(pinfo)); } static void diff --git a/epan/dissectors/packet-http3.c b/epan/dissectors/packet-http3.c index c7dc744a07..6d933a4a5b 100644 --- a/epan/dissectors/packet-http3.c +++ b/epan/dissectors/packet-http3.c @@ -211,7 +211,7 @@ dissect_http3_settings(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* http3_ pi = proto_tree_add_item_ret_varint(settings_tree, hf_http3_settings_identifier, tvb, offset, -1, ENC_VARINT_QUIC, &settingsid, &lenvar); /* Check if it is a GREASE Settings ID */ if (http3_is_reserved_code(settingsid)) { - proto_item_set_text(pi, "Type: GREASE (%#" G_GINT64_MODIFIER "x)", settingsid); + proto_item_set_text(pi, "Type: GREASE (%#" PRIx64 ")", settingsid); proto_item_append_text(ti_settings, " - GREASE" ); } else { proto_item_append_text(ti_settings, " - %s", @@ -224,15 +224,15 @@ dissect_http3_settings(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* http3_ switch(settingsid){ case HTTP3_QPACK_MAX_TABLE_CAPACITY: proto_tree_add_item_ret_varint(settings_tree, hf_http3_settings_qpack_max_table_capacity, tvb, offset, -1, ENC_VARINT_QUIC, &value, &lenvar); - proto_item_append_text(ti_settings, ": %" G_GINT64_MODIFIER "u", value ); + proto_item_append_text(ti_settings, ": %" PRIu64, value ); break; case HTTP3_SETTINGS_MAX_FIELD_SECTION_SIZE: proto_tree_add_item_ret_varint(settings_tree, hf_http3_settings_max_field_section_size, tvb, offset, -1, ENC_VARINT_QUIC, &value, &lenvar); - proto_item_append_text(ti_settings, ": %" G_GINT64_MODIFIER "u", value ); + proto_item_append_text(ti_settings, ": %" PRIu64, value ); break; case HTTP3_QPACK_BLOCKED_STREAMS: proto_tree_add_item_ret_varint(settings_tree, hf_http3_settings_qpack_blocked_streams, tvb, offset, -1, ENC_VARINT_QUIC, &value, &lenvar); - proto_item_append_text(ti_settings, ": %" G_GINT64_MODIFIER "u", value ); + proto_item_append_text(ti_settings, ": %" PRIu64, value ); break; default: /* No Default */ @@ -254,7 +254,7 @@ dissect_http3_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int off pi = proto_tree_add_item_ret_varint(tree, hf_http3_frame_type, tvb, offset, -1, ENC_VARINT_QUIC, &frame_type, &lenvar); offset += lenvar; if (http3_is_reserved_code(frame_type)) { - proto_item_set_text(pi, "Type: Reserved (%#" G_GINT64_MODIFIER "x)", frame_type); + proto_item_set_text(pi, "Type: Reserved (%#" PRIx64 ")", frame_type); } else { col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val64_to_str_const(frame_type, http3_frame_types, "Unknown")); } @@ -290,7 +290,7 @@ report_unknown_stream_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * https://tools.ietf.org/html/draft-ietf-quic-http-29#page-28 */ proto_tree_add_expert_format(tree, pinfo, &ei_http3_unknown_stream_type, tvb, offset, 0, - "Unknown stream type %#" G_GINT64_MODIFIER "x on Stream ID %#" G_GINT64_MODIFIER "x", + "Unknown stream type %#" PRIx64 " on Stream ID %#" PRIx64, h3_stream->uni_stream_type, stream_info->stream_id); } @@ -306,7 +306,7 @@ dissect_http3_uni_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in offset += lenvar; if (http3_is_reserved_code(stream_type)) { // Reserved to exercise requirement that unknown types are ignored. - proto_item_set_text(pi, "Stream Type: Reserved (%#" G_GINT64_MODIFIER "x)", stream_type); + proto_item_set_text(pi, "Stream Type: Reserved (%#" PRIx64 ")", stream_type); } h3_stream->uni_stream_type = stream_type; } else { diff --git a/epan/dissectors/packet-i2c.c b/epan/dissectors/packet-i2c.c index 67095cbddc..ff92a73de6 100644 --- a/epan/dissectors/packet-i2c.c +++ b/epan/dissectors/packet-i2c.c @@ -68,7 +68,7 @@ static dissector_handle_t ipmb_handle; static void i2c_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Interpret I2C messages as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Interpret I2C messages as"); } static gboolean diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c index 23cc30c702..5805d4894c 100644 --- a/epan/dissectors/packet-iax2.c +++ b/epan/dissectors/packet-iax2.c @@ -650,7 +650,7 @@ static gchar *key_to_str( const iax_circuit_key *key ) strp = str[i]; addrstr = address_to_str(NULL, &key->addr); - g_snprintf(strp, 80, "{%s:%i,%i}", + snprintf(strp, 80, "{%s:%i,%i}", addrstr, key->port, key->callno); diff --git a/epan/dissectors/packet-idn.c b/epan/dissectors/packet-idn.c index 6330a6ded1..2fa4f58543 100644 --- a/epan/dissectors/packet-idn.c +++ b/epan/dissectors/packet-idn.c @@ -371,25 +371,25 @@ static void determine_color(guint16 catsub, configuration_info *config) { const int l = (const int)strlen(column_str); switch(catsub) { case IDNTAG_COLOR_RED: - g_snprintf(column_str+l, MAX_BUFFER-l, " R"); + snprintf(column_str+l, MAX_BUFFER-l, " R"); break; case IDNTAG_COLOR_GREEN: - g_snprintf(column_str+l, MAX_BUFFER-l, " G"); + snprintf(column_str+l, MAX_BUFFER-l, " G"); break; case IDNTAG_COLOR_BLUE: - g_snprintf(column_str+l, MAX_BUFFER-l, " B"); + snprintf(column_str+l, MAX_BUFFER-l, " B"); break; case IDNTAG_OPTIONAL_U1: - g_snprintf(column_str+l, MAX_BUFFER-l, " U1"); + snprintf(column_str+l, MAX_BUFFER-l, " U1"); break; case IDNTAG_OPTIONAL_U2: - g_snprintf(column_str+l, MAX_BUFFER-l, " U2"); + snprintf(column_str+l, MAX_BUFFER-l, " U2"); break; case IDNTAG_OPTIONAL_U3: - g_snprintf(column_str+l, MAX_BUFFER-l, " U3"); + snprintf(column_str+l, MAX_BUFFER-l, " U3"); break; default: - g_snprintf(column_str+l, MAX_BUFFER-l, " C"); + snprintf(column_str+l, MAX_BUFFER-l, " C"); } } @@ -423,7 +423,7 @@ static int dissect_idn_dmx_sample_values(tvbuff_t *tvb, int offset, proto_tree * for(i=0; i+16<=data_size; i+=16) { l = 0; for(j=1; j<16; j++){ - l += g_snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_guint8(tvb, offset+j)); + l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_guint8(tvb, offset+j)); } proto_tree_add_int_format(idn_dmx_subtree, idn_gts_sample, tvb, offset, 16, 16, "%3d: %s", base+i, values); offset += 16; @@ -432,7 +432,7 @@ static int dissect_idn_dmx_sample_values(tvbuff_t *tvb, int offset, proto_tree * if(rest > 0) { l = 0; for(j=0; jdic_precision)[2] == 1) - l += g_snprintf(values, MAX_BUFFER, "%5d", tvb_get_guint16(tvb, offset, 2)); + l += snprintf(values, MAX_BUFFER, "%5d", tvb_get_guint16(tvb, offset, 2)); else - l += g_snprintf(values, MAX_BUFFER, "%5d", tvb_get_guint8(tvb, offset)); + l += snprintf(values, MAX_BUFFER, "%5d", tvb_get_guint8(tvb, offset)); for(i=1; isample_size && (l < MAX_BUFFER-100); i++){ if((config->dic_precision)[i+1] == 1) { //do nothing }else if((config->dic_precision)[i+2] == 1) { - l += g_snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_guint16(tvb, offset+i, 2)); + l += snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_guint16(tvb, offset+i, 2)); i++; }else { - l += g_snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_guint8(tvb, offset+i)); + l += snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_guint8(tvb, offset+i)); } } } @@ -472,7 +472,7 @@ static int dissect_idn_octet_segment(tvbuff_t *tvb, int offset, proto_tree *idn_ for(i=0; i+16<=data_size; i+=16) { l = 0; for(j=0; j<16 && (l < MAX_BUFFER-100); j++){ - l += g_snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_gint8(tvb, offset+j)); + l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_gint8(tvb, offset+j)); } proto_tree_add_int_format(idn_samples_tree, idn_gts_sample, tvb, offset, 16, 16, "%s", values); offset += 16; @@ -481,7 +481,7 @@ static int dissect_idn_octet_segment(tvbuff_t *tvb, int offset, proto_tree *idn_ if(rest > 0) { l = 0; for(j=0; jword_count*2; i++) { catsub = tvb_get_guint16(tvb, offset, 2); const int l = (const int)strlen(column_str); @@ -813,38 +813,38 @@ static int dissect_idn_laser_dictionary(tvbuff_t *tvb, int offset, proto_tree *i offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_space_modifier, &dictionary_size, config, 0); }else if(catsub == IDNTAG_NOP) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_nop, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " NOP"); + snprintf(column_str+l, MAX_BUFFER-l, " NOP"); }else if(catsub >= IDNTAG_HINT0 && catsub <= IDNTAG_HINT1) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_hint, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " H"); + snprintf(column_str+l, MAX_BUFFER-l, " H"); }else if(catsub >= IDNTAG_COORD_X && catsub <= IDNTAG_COORD_X_END) { offset = dissect_idn_x_area(tvb, offset, gts_tree, catsub, &dictionary_size, config); }else if(catsub >= IDNTAG_COORD_Y && catsub <= IDNTAG_COORD_Y_END) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_y, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " Y"); + snprintf(column_str+l, MAX_BUFFER-l, " Y"); }else if(catsub >= IDNTAG_COORD_Z && catsub <= IDNTAG_COORD_Z_END) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_z, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " Z"); + snprintf(column_str+l, MAX_BUFFER-l, " Z"); }else if(catsub >= IDNTAG_COLOR_START && catsub <= IDNTAG_COLOR_END) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_color, &dictionary_size, config, 1); determine_color(catsub, config); }else if(catsub == IDNTAG_WAVELENGTH_PREFIX) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_wavelength_prefix, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " WP"); + snprintf(column_str+l, MAX_BUFFER-l, " WP"); }else if(catsub == IDNTAG_INTENSITY) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_intensity, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " I"); + snprintf(column_str+l, MAX_BUFFER-l, " I"); }else if(catsub == IDNTAG_BEAM_BRUSH) { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_beam_brush, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " BB"); + snprintf(column_str+l, MAX_BUFFER-l, " BB"); }else { offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts, &dictionary_size, config, 1); - g_snprintf(column_str+l, MAX_BUFFER-l, " U/R"); + snprintf(column_str+l, MAX_BUFFER-l, " U/R"); } } proto_item_set_len(gts_tree, dictionary_size); const int l = (const int)strlen(column_str); - g_snprintf(column_str+l, MAX_BUFFER-l, " )"); + snprintf(column_str+l, MAX_BUFFER-l, " )"); return offset; } @@ -988,10 +988,10 @@ static int dissect_idn_servicemap_entry(tvbuff_t *tvb, int offset, proto_tree *i char tree_title[MAX_BUFFER]; if(service_id == 0) { - g_snprintf(tree_title, MAX_BUFFER, "Relay Entry - %s", name); + snprintf(tree_title, MAX_BUFFER, "Relay Entry - %s", name); idn_servicemap_entry_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 24, ett_idn_header_tree, NULL, tree_title); }else { - g_snprintf(tree_title, MAX_BUFFER, "Service Entry - %s", name); + snprintf(tree_title, MAX_BUFFER, "Service Entry - %s", name); idn_servicemap_entry_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 24, ett_idn_header_tree, NULL, tree_title); } diff --git a/epan/dissectors/packet-ieee1609dot2.c b/epan/dissectors/packet-ieee1609dot2.c index 0b6ed840c8..76e76ac3bd 100644 --- a/epan/dissectors/packet-ieee1609dot2.c +++ b/epan/dissectors/packet-ieee1609dot2.c @@ -2163,7 +2163,7 @@ ieee1609dot2_Time64_fmt(gchar *s, guint64 v) time_t secs = v / 1000000 + 1072915200 - 5; guint32 usecs = v % 1000000; struct tm *tm = gmtime(&secs); - snprintf(s, ITEM_LABEL_LENGTH, "%u-%02u-%02u %02u:%02u:%02u.%06u (%" G_GUINT64_FORMAT ")", + snprintf(s, ITEM_LABEL_LENGTH, "%u-%02u-%02u %02u:%02u:%02u.%06u (%" PRIu64 ")", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, usecs, v ); } diff --git a/epan/dissectors/packet-ieee17221.c b/epan/dissectors/packet-ieee17221.c index 7699457cff..a90000f97e 100644 --- a/epan/dissectors/packet-ieee17221.c +++ b/epan/dissectors/packet-ieee17221.c @@ -4553,7 +4553,7 @@ dissect_17221_aecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aecp_tree) /* attempt to dissect the payload specific data */ next_tvb = tvb_new_subset_remaining(tvb, AECP_VUC_OFFSET_PROTOCOL_ID); vendor_unique_protocol_id = tvb_get_guint48(tvb, AECP_VUC_OFFSET_PROTOCOL_ID, ENC_BIG_ENDIAN); - vendor_unique_protocol_id_string = wmem_strdup_printf(pinfo->pool, "%012" G_GINT64_MODIFIER "x", vendor_unique_protocol_id); + vendor_unique_protocol_id_string = wmem_strdup_printf(pinfo->pool, "%012" PRIx64, vendor_unique_protocol_id); dissector_try_string(vendor_unique_protocol_dissector_table, vendor_unique_protocol_id_string, next_tvb, pinfo, aecp_tree, NULL); } } diff --git a/epan/dissectors/packet-ieee1905.c b/epan/dissectors/packet-ieee1905.c index 0d2a71d991..ad4b609d7d 100644 --- a/epan/dissectors/packet-ieee1905.c +++ b/epan/dissectors/packet-ieee1905.c @@ -3435,14 +3435,14 @@ static void rcpi_threshold_custom(gchar *result, guint8 rcpi_threshold) { if (rcpi_threshold == 0) { - g_snprintf(result, ITEM_LABEL_LENGTH, "Do not report STA Metrics based on RCPI threshold"); + snprintf(result, ITEM_LABEL_LENGTH, "Do not report STA Metrics based on RCPI threshold"); } else if (rcpi_threshold > 0 && rcpi_threshold < 220) { - g_snprintf(result, ITEM_LABEL_LENGTH, "RCPI Threshold = %.1fdBm", + snprintf(result, ITEM_LABEL_LENGTH, "RCPI Threshold = %.1fdBm", (float)rcpi_threshold/2 - 110); } else if (rcpi_threshold == 220) { - g_snprintf(result, ITEM_LABEL_LENGTH, "RCPI Threshold >= 0dBm"); + snprintf(result, ITEM_LABEL_LENGTH, "RCPI Threshold >= 0dBm"); } else { - g_snprintf(result, ITEM_LABEL_LENGTH, "Reserved"); + snprintf(result, ITEM_LABEL_LENGTH, "Reserved"); } } @@ -3450,9 +3450,9 @@ static void rcpi_hysteresis_custom(gchar *result, guint8 rcpi_hysteresis) { if (rcpi_hysteresis == 0) { - g_snprintf(result, ITEM_LABEL_LENGTH, "Use Agent's implementation-specific default RCPI Hysteresis margin"); + snprintf(result, ITEM_LABEL_LENGTH, "Use Agent's implementation-specific default RCPI Hysteresis margin"); } else { - g_snprintf(result, ITEM_LABEL_LENGTH, "%udB", rcpi_hysteresis); + snprintf(result, ITEM_LABEL_LENGTH, "%udB", rcpi_hysteresis); } } diff --git a/epan/dissectors/packet-ieee80211-prism.c b/epan/dissectors/packet-ieee80211-prism.c index 03790ec1b0..b8eec55f94 100644 --- a/epan/dissectors/packet-ieee80211-prism.c +++ b/epan/dissectors/packet-ieee80211-prism.c @@ -243,7 +243,7 @@ static const value_string prism_istx_vals[] = static void prism_rate_base_custom(gchar *result, guint32 rate) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%u.%u", rate /2, rate & 1 ? 5 : 0); + snprintf(result, ITEM_LABEL_LENGTH, "%u.%u", rate /2, rate & 1 ? 5 : 0); } static gchar * diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c index 23a39bad22..06db9ffd32 100644 --- a/epan/dissectors/packet-ieee80211-radiotap.c +++ b/epan/dissectors/packet-ieee80211-radiotap.c @@ -1452,14 +1452,14 @@ dissect_radiotap_he_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree static void not_captured_custom(gchar *result, guint32 value _U_) { - g_snprintf(result, ITEM_LABEL_LENGTH, + snprintf(result, ITEM_LABEL_LENGTH, "NOT CAPTURED BY CAPTURE SOFTWARE"); } static void he_sig_b_symbols_custom(gchar *result, guint32 value) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1); + snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1); } static void diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 6e9f06ba11..fd4a23a14b 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -8022,7 +8022,7 @@ beacon_interval_base_custom(gchar *result, guint32 beacon_interval) double temp_double; temp_double = (double)beacon_interval; - g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000)); + snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000)); } static void @@ -8031,19 +8031,19 @@ allocation_duration_base_custom(gchar *result, guint32 allocation_duration) double temp_double; temp_double = (double)allocation_duration; - g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double / 1000000)); + snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double / 1000000)); } static void extra_one_base_custom(gchar *result, guint32 value) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1); + snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1); } static void extra_one_mul_two_base_custom(gchar *result, guint32 value) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d", (value+1)*2); + snprintf(result, ITEM_LABEL_LENGTH, "%d", (value+1)*2); } static void @@ -8053,40 +8053,40 @@ rcpi_and_power_level_custom(gchar *result, guint8 value) RCPI = |2 x (P + 110)| in steps of 0.5 dB */ if (value == 0) - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (P < -109.5 dBm)", value); + snprintf(result, ITEM_LABEL_LENGTH, "%d (P < -109.5 dBm)", value); else if (value == 220) - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (P >= 0 dBm)", value); + snprintf(result, ITEM_LABEL_LENGTH, "%d (P >= 0 dBm)", value); else if (value < 220) - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (P = %.1f dBm)", value, ((double)value) / 2 - 110); + snprintf(result, ITEM_LABEL_LENGTH, "%d (P = %.1f dBm)", value, ((double)value) / 2 - 110); else if (value < 255) - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (Reserved)", value); + snprintf(result, ITEM_LABEL_LENGTH, "%d (Reserved)", value); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (Measurement not available)", value); + snprintf(result, ITEM_LABEL_LENGTH, "%d (Measurement not available)", value); } static void sts_custom(gchar *result, guint32 value) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d STS", value + 1); + snprintf(result, ITEM_LABEL_LENGTH, "%d STS", value + 1); } static void rep_custom(gchar *result, guint32 value) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%u repetition%s (%u)", value + 1, plurality(value + 1, "", "s"), value); + snprintf(result, ITEM_LABEL_LENGTH, "%u repetition%s (%u)", value + 1, plurality(value + 1, "", "s"), value); } static void hundred_us_base_custom(gchar *result, guint32 value) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%0.1f ms (%u)", ((double)value * 100 / 1000), value); + snprintf(result, ITEM_LABEL_LENGTH, "%0.1f ms (%u)", ((double)value * 100 / 1000), value); } static void partial_tsf_custom(gchar *result, guint32 value) { guint32 shifted = value << 10; - g_snprintf(result, ITEM_LABEL_LENGTH, "%u %s (%u)", shifted, + snprintf(result, ITEM_LABEL_LENGTH, "%u %s (%u)", shifted, unit_name_string_get_value(shifted, &units_microseconds), value); } @@ -8180,9 +8180,9 @@ he_ru_allocation_base_custom(gchar *result, guint32 ru_allocation) } if (tones) - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (%d tones)", ru_allocation, tones); + snprintf(result, ITEM_LABEL_LENGTH, "%d (%d tones)", ru_allocation, tones); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (bogus number of tones)", ru_allocation); + snprintf(result, ITEM_LABEL_LENGTH, "%d (bogus number of tones)", ru_allocation); } /* @@ -8192,11 +8192,11 @@ static void vs_sgdsn_serialnumber_len_custom(gchar *result, guint32 val) { if (val >= 0x30 && val <= 0x39) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d byte(s)", val-0x30); + snprintf(result, ITEM_LABEL_LENGTH, "%d byte(s)", val-0x30); } else if (val >= 0x41 && val <= 0x46) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d byte(s)", val-0x37); + snprintf(result, ITEM_LABEL_LENGTH, "%d byte(s)", val-0x37); } else { - g_snprintf(result, ITEM_LABEL_LENGTH, "Invalid length: %u", val); + snprintf(result, ITEM_LABEL_LENGTH, "Invalid length: %u", val); } } @@ -8492,7 +8492,7 @@ add_mimo_compressed_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, static void mesh_active_window_base_custom(gchar *result, guint32 mesh_active_window) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (mesh_active_window * 1024.0 / 1000000)); + snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (mesh_active_window * 1024.0 / 1000000)); } /* ************************************************************************* */ @@ -8868,16 +8868,16 @@ dissect_dscp_policy_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item(status_tree, hf_ieee80211_dscp_policy_id, tvb, offset, 1, ENC_NA); if (sts_len == 0) { - sts_len += g_snprintf(status_buf + sts_len, 256 - sts_len, "%u:", scsid); + sts_len += snprintf(status_buf + sts_len, 256 - sts_len, "%u:", scsid); } else { - sts_len += g_snprintf(status_buf + sts_len, 256 - sts_len, " %u:", scsid); + sts_len += snprintf(status_buf + sts_len, 256 - sts_len, " %u:", scsid); } offset += 1; status = tvb_get_guint8(tvb, offset); proto_tree_add_item(status_tree, hf_ieee80211_dscp_policy_status, tvb, offset, 1, ENC_NA); - sts_len += g_snprintf(status_buf + sts_len, 256 - sts_len, "%u", status); + sts_len += snprintf(status_buf + sts_len, 256 - sts_len, "%u", status); offset += 1; } proto_tree_add_string(tree, hf_ieee80211_dscp_policy_scs_sts_list, tvb, 0, 1, @@ -14590,16 +14590,16 @@ s1g_sector_id_index_snr_custom(gchar *result, guint16 snr) { switch (snr) { case 0: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Less than or equal to -3dB"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Less than or equal to -3dB"); break; case 30: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Greater than or equal to 27dB"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Greater than or equal to 27dB"); break; case 31: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "No Feedback"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "No Feedback"); break; default: - g_snprintf(result, ITEM_LABEL_LENGTH, "%ddB", snr - 3); + snprintf(result, ITEM_LABEL_LENGTH, "%ddB", snr - 3); } } @@ -15871,11 +15871,11 @@ oui_base_custom(gchar *result, guint32 oui) manuf_name = uint_get_manuf_name_if_known(oui); if (manuf_name == NULL) { /* Could not find an OUI. */ - g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x", p_oui[0], p_oui[1], p_oui[2]); + snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x", p_oui[0], p_oui[1], p_oui[2]); } else { /* Found an address string. */ - g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name); + snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name); } } @@ -15888,7 +15888,7 @@ rsn_gcs_base_custom(gchar *result, guint32 gcs) oui_result[0] = '\0'; oui_base_custom(oui_result, gcs >> 8); tmp_str = val_to_str_wmem(NULL, gcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d"); - g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); + snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); wmem_free(NULL, tmp_str); } @@ -15901,7 +15901,7 @@ rsn_pcs_base_custom(gchar *result, guint32 pcs) oui_result[0] = '\0'; oui_base_custom(oui_result, pcs >> 8); tmp_str = val_to_str_wmem(NULL, pcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d"); - g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); + snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); wmem_free(NULL, tmp_str); } @@ -15914,7 +15914,7 @@ rsn_akms_base_custom(gchar *result, guint32 akms) oui_result[0] = '\0'; oui_base_custom(oui_result, akms >> 8); tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_rsn_keymgmt_vals, "Unknown %d"); - g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); + snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); wmem_free(NULL, tmp_str); } @@ -15951,7 +15951,7 @@ rsn_gmcs_base_custom(gchar *result, guint32 gmcs) oui_result[0] = '\0'; oui_base_custom(oui_result, gmcs >> 8); tmp_str = val_to_str_wmem(NULL, gmcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d"); - g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); + snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); wmem_free(NULL, tmp_str); } @@ -15962,9 +15962,9 @@ rsni_base_custom(gchar *result, guint8 rsni) if (rsni < 255) { temp_double = (double)rsni - 20; - g_snprintf(result, ITEM_LABEL_LENGTH, "%.1f dB", (temp_double / 2)); + snprintf(result, ITEM_LABEL_LENGTH, "%.1f dB", (temp_double / 2)); } else - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (Measurement not available)", rsni); + snprintf(result, ITEM_LABEL_LENGTH, "%d (Measurement not available)", rsni); } static void @@ -15973,7 +15973,7 @@ vht_tpe_custom(gchar *result, guint8 txpwr) gint8 txpwr_db; txpwr_db = (gint8)(txpwr); - g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm", (txpwr_db/2.0)); + snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm", (txpwr_db/2.0)); } static void @@ -15983,11 +15983,11 @@ tpe_psd_custom(gchar *result, guint8 txpwr) txpwr_db = (gint8)(txpwr); if (txpwr_db == -128) { - g_snprintf(result, ITEM_LABEL_LENGTH, "Channel cannot be used for transmission"); + snprintf(result, ITEM_LABEL_LENGTH, "Channel cannot be used for transmission"); } else if (txpwr_db == 127) { - g_snprintf(result, ITEM_LABEL_LENGTH, "No maximum PSD is specified for channel"); + snprintf(result, ITEM_LABEL_LENGTH, "No maximum PSD is specified for channel"); } else { - g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm/MHz", (txpwr_db/2.0)); + snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm/MHz", (txpwr_db/2.0)); } } @@ -15996,13 +15996,13 @@ channel_number_custom(gchar *result, guint8 channel_number) { switch(channel_number){ case 0: - g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels in the specified Operating Class)", channel_number); + snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels in the specified Operating Class)", channel_number); break; case 255: - g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels listed in the AP Channel Report)", channel_number); + snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels listed in the AP Channel Report)", channel_number); break; default : - g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on that Channel Number)", channel_number); + snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on that Channel Number)", channel_number); break; } } @@ -16122,7 +16122,7 @@ wpa_mcs_base_custom(gchar *result, guint32 mcs) oui_result[0] = '\0'; oui_base_custom(oui_result, mcs >> 8); tmp_str = val_to_str_wmem(NULL, mcs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d"); - g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); + snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); wmem_free(NULL, tmp_str); } @@ -16135,7 +16135,7 @@ wpa_ucs_base_custom(gchar *result, guint32 ucs) oui_result[0] = '\0'; oui_base_custom(oui_result, ucs >> 8); tmp_str = val_to_str_wmem(NULL, ucs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d"); - g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); + snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); wmem_free(NULL, tmp_str); } static void @@ -16147,7 +16147,7 @@ wpa_akms_base_custom(gchar *result, guint32 akms) oui_result[0] = '\0'; oui_base_custom(oui_result, akms >> 8); tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_wfa_ie_wpa_keymgmt_vals, "Unknown %d"); - g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); + snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str); wmem_free(NULL, tmp_str); } @@ -16732,7 +16732,7 @@ dissect_hs20_osen(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* hf_ieee80211_osen_pairwise_cipher_suite_type }; char label[128]; - g_snprintf(label, sizeof(label), "OSEN Pairwise Cipher Suite %d", pwc_index); + snprintf(label, sizeof(label), "OSEN Pairwise Cipher Suite %d", pwc_index); offset = dissect_group_data_cipher_suite(tvb, pinfo, pwc_list, offset, hf_array2, ett_osen_pairwise_cipher_suite, label); @@ -16772,7 +16772,7 @@ dissect_hs20_osen(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* hf_ieee80211_osen_akm_cipher_suite_type}; char label[128]; - g_snprintf(label, sizeof(label), "OSEN AKM Cipher Suite %d", akms_index); + snprintf(label, sizeof(label), "OSEN AKM Cipher Suite %d", akms_index); offset = dissect_group_data_cipher_suite(tvb, pinfo, akm_list, offset, hf_array3, ett_osen_akm_cipher_suite, label); @@ -20401,7 +20401,7 @@ dissect_subchannel_selective_transmission(tvbuff_t *tvb, packet_info *pinfo _U_, static void s1g_open_loop_link_margin_custom(gchar *result, guint8 ollm_index) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dB", + snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dB", (-128.0 + ollm_index * 0.5)); } @@ -20439,53 +20439,53 @@ s1g_raw_type_options_custom(gchar *result, guint8 raw_type) case 0x00: switch (raw_type) { case 0x00: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "None"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "None"); break; case 0x01: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Paged STA"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Paged STA"); break; case 0x02: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "RA Frame"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "RA Frame"); break; case 0x03: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Paged STA and RA Frame"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Paged STA and RA Frame"); break; } break; case 0x01: switch (raw_type) { case 0x00: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "SST sounding RAW"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "SST sounding RAW"); break; case 0x01: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "SST report RAW"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "SST report RAW"); break; case 0x02: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Sector sounding RAW"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Sector sounding RAW"); break; case 0x03: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Sector report RAW"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Sector report RAW"); break; } break; case 0x02: switch (raw_type) { case 0x00: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "AP PM RAW"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "AP PM RAW"); break; case 0x01: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Non-TIM RAW"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Non-TIM RAW"); break; case 0x02: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Omni RAW"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Omni RAW"); break; case 0x03: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Reserved"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Reserved"); break; } break; case 0x03: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Reserved"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Reserved"); break; } } @@ -20959,27 +20959,27 @@ enable_relay_function_custom(gchar *result, guint8 enable_relay_function) switch (relay_function_field & 0x03) { case 0x00: /* Relay Activation Mode == 0 && Direction == 0 */ if (enable_relay_function) - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA activates its relay function"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA activates its relay function"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA terminates its relay function"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA terminates its relay function"); break; case 0x01: /* Relay Activation Mode == 1 && Direction == 0 */ if (enable_relay_function) - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA requests to activate relay function"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA requests to activate relay function"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA requests to terminate relay function"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA requests to terminate relay function"); break; case 0x02: /* Relay Activation Mode == 0 && Direction == 1 */ if (enable_relay_function) - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA is allowed to operate as a relay"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA is allowed to operate as a relay"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA must not operate as a relay"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "non-AP STA must not operate as a relay"); break; case 0x03: /* Relay Activation Mode == 1 && Direction == 1 */ if (enable_relay_function) - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Non-AP STA can operate as a relay"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Non-AP STA can operate as a relay"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Non-AP STA must terminate relay function"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Non-AP STA must terminate relay function"); break; } } @@ -21216,15 +21216,15 @@ static void s1g_max_awake_duration_custom(gchar *result, guint16 duration) { if (duration == 0) - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "No limit applies"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "No limit applies"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%d uS", (int)duration * 40); + snprintf(result, ITEM_LABEL_LENGTH, "%d uS", (int)duration * 40); } static void s1g_recovery_time_duration_custom(gchar *result, guint16 duration) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d uS", (int)duration * 40); + snprintf(result, ITEM_LABEL_LENGTH, "%d uS", (int)duration * 40); } static int @@ -22887,9 +22887,9 @@ static void ul_target_rssi_base_custom(gchar *result, guint32 target_rssi) { if (target_rssi <= 30) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -90 + (2 * target_rssi)); + snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -90 + (2 * target_rssi)); } else if (target_rssi == 31) { - g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power"); + snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power"); } } @@ -27481,9 +27481,9 @@ static void max_frag_msdus_base_custom(gchar *result, guint32 max_frag_msdus_value) { if (max_frag_msdus_value == 7) - g_snprintf(result, ITEM_LABEL_LENGTH, "No restriction"); + snprintf(result, ITEM_LABEL_LENGTH, "No restriction"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%u", 1 << max_frag_msdus_value); + snprintf(result, ITEM_LABEL_LENGTH, "%u", 1 << max_frag_msdus_value); } static const val64_string he_link_adaptation_support_vals[] = { @@ -31221,9 +31221,9 @@ static void ap_tx_power_custom(gchar *result, guint32 ap_tx_power) { if (ap_tx_power > 60) - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", "Reserved"); + snprintf(result, ITEM_LABEL_LENGTH, "%s", "Reserved"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%d dBm", -20 + ap_tx_power); + snprintf(result, ITEM_LABEL_LENGTH, "%d dBm", -20 + ap_tx_power); } static void @@ -31234,12 +31234,12 @@ ul_packet_extension_base_custom(gchar *result, guint32 ul_packet_extension) if (pre_fec_padding == 0) pre_fec_padding = 4; if (ul_packet_extension & PE_DISAMBIGUITY) { - g_snprintf(result, ITEM_LABEL_LENGTH, + snprintf(result, ITEM_LABEL_LENGTH, "PE disambiguity & pre-FEC padding factor of %d", pre_fec_padding); } else { - g_snprintf(result, ITEM_LABEL_LENGTH, + snprintf(result, ITEM_LABEL_LENGTH, "no PE disambiguity & pre-FEC padding factor of %d", pre_fec_padding); } @@ -31339,17 +31339,17 @@ static void he_trigger_ru_allocation_region_custom(gchar *result, guint32 ru_alloc_val) { if (global_he_trigger_bw == 3) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", + snprintf(result, ITEM_LABEL_LENGTH, "%s", he_trigger_ru_allocation_region_values[ru_alloc_val & 0x01]); } else { - g_snprintf(result, ITEM_LABEL_LENGTH, "Not used for 20, 40 or 80MHz"); + snprintf(result, ITEM_LABEL_LENGTH, "Not used for 20, 40 or 80MHz"); } } static void he_trigger_minus_one_custom(gchar *result, guint ss_alloc_value) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d", ss_alloc_value + 1); + snprintf(result, ITEM_LABEL_LENGTH, "%d", ss_alloc_value + 1); } static const true_false_string he_trigger_ul_fec_coding_type_tfs = { @@ -31534,11 +31534,11 @@ static void target_rssi_base_custom(gchar *result, guint32 target_rssi) { if (target_rssi <= 90) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -110 + target_rssi); + snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -110 + target_rssi); } else if (target_rssi == 127) { - g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power"); + snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power"); } else { - g_snprintf(result, ITEM_LABEL_LENGTH, "Reserved"); + snprintf(result, ITEM_LABEL_LENGTH, "Reserved"); } } @@ -34043,7 +34043,7 @@ dissect_ieee80211_pv0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item_set_len(ti, hdr_len + 8); if (algorithm==PROTECTION_ALG_TKIP) { - g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X", + snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X", tvb_get_letohl(tvb, hdr_len + 4), tvb_get_guint8(tvb, hdr_len), tvb_get_guint8(tvb, hdr_len + 2)); @@ -34051,7 +34051,7 @@ dissect_ieee80211_pv0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, EXTIV_LEN, out_buff); } else if (algorithm == PROTECTION_ALG_CCMP || algorithm == PROTECTION_ALG_CCMP_256 || algorithm == PROTECTION_ALG_GCMP || algorithm == PROTECTION_ALG_GCMP_256) { - g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X", + snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X", tvb_get_letohl(tvb, hdr_len + 4), tvb_get_guint8(tvb, hdr_len + 1), tvb_get_guint8(tvb, hdr_len)); diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index dbc15a90df..91df22bc95 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -3274,7 +3274,7 @@ dissect_ieee802154_tap_tlvs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case IEEE802154_TAP_ASN: proto_tree_add_item_ret_uint64(tlvtree, hf_ieee802154_asn, tvb, offset, 8, ENC_LITTLE_ENDIAN, &ieee802154_tsch_asn); - proto_item_append_text(proto_tree_get_parent(tlvtree), ": %"G_GUINT64_FORMAT, ieee802154_tsch_asn); + proto_item_append_text(proto_tree_get_parent(tlvtree), ": %"PRIu64, ieee802154_tsch_asn); break; case IEEE802154_TAP_SLOT_START_TS: proto_tree_add_item_ret_uint64(tlvtree, hf_ieee802154_slot_start_ts, tvb, offset, 8, @@ -3286,7 +3286,7 @@ dissect_ieee802154_tap_tlvs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case IEEE802154_TAP_TIMESLOT_LENGTH: proto_tree_add_item_ret_uint(tlvtree, hf_ieee802154_tap_timeslot_length, tvb, offset, 4, ENC_LITTLE_ENDIAN, ×lot_length); - proto_item_append_text(proto_tree_get_parent(tlvtree), ": %"G_GUINT32_FORMAT" %s", timeslot_length, units_microseconds.singular); + proto_item_append_text(proto_tree_get_parent(tlvtree), ": %"PRIu32" %s", timeslot_length, units_microseconds.singular); break; case IEEE802154_TAP_LQI: { guint32 lqi; @@ -5516,9 +5516,9 @@ static void ieee802154_da_prompt(packet_info *pinfo _U_, gchar* result) ieee802154_hints_t *hints; hints = (ieee802154_hints_t *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ieee802154, 0); if (hints) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IEEE 802.15.4 PAN 0x%04x as", hints->src_pan); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IEEE 802.15.4 PAN 0x%04x as", hints->src_pan); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IEEE 802.15.4 PAN Unknown"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IEEE 802.15.4 PAN Unknown"); } /* iee802154_da_prompt */ /* Returns the value to index the panid decode table with (source PAN)*/ diff --git a/epan/dissectors/packet-igmp.c b/epan/dissectors/packet-igmp.c index 9320e124c0..3ebcbafe12 100644 --- a/epan/dissectors/packet-igmp.c +++ b/epan/dissectors/packet-igmp.c @@ -768,7 +768,7 @@ dissect_igmp_mtrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, type = tvb_get_guint8(tvb, offset); if (type == IGMP_TRACEROUTE_RESPONSE) { int i = (tvb_reported_length_remaining(tvb, offset) - IGMP_TRACEROUTE_HDR_LEN) / IGMP_TRACEROUTE_RSP_LEN; - g_snprintf(buf, sizeof buf, ", %d block%s", i, plurality(i, "", "s")); + snprintf(buf, sizeof buf, ", %d block%s", i, plurality(i, "", "s")); typestr = "Traceroute Response"; blocks = buf; } else if (tvb_reported_length_remaining(tvb, offset) == IGMP_TRACEROUTE_HDR_LEN) diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c index dfd3acde35..a74d165576 100644 --- a/epan/dissectors/packet-infiniband.c +++ b/epan/dissectors/packet-infiniband.c @@ -1691,7 +1691,7 @@ static heur_dissector_list_t heur_dissectors_cm_private; /* ----- This sections contains various utility functions indirectly related to Infiniband dissection ---- */ static void infiniband_payload_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect Infiniband payload as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect Infiniband payload as"); } static void table_destroy_notify(gpointer data) { diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index d2e75a4cb3..afb9c748f0 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -476,7 +476,7 @@ const value_string ip_version_vals[] = { static void ip_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_ip, pinfo->curr_layer_num))); } @@ -984,7 +984,7 @@ dissect_ipopt_cipso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * bit_spot = 0; while (bit_spot < 8) { if (val_ptr[byte_spot] & bitmask) { - g_snprintf(cat_str_tmp, USHRT_MAX_STRLEN, "%u", + snprintf(cat_str_tmp, USHRT_MAX_STRLEN, "%u", byte_spot * 8 + bit_spot); if (cat_str_len < (strlen(cat_str) + 2 + USHRT_MAX_STRLEN)) { char *cat_str_new; @@ -1034,7 +1034,7 @@ dissect_ipopt_cipso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * char *cat_str_tmp = (char *)wmem_alloc(pinfo->pool, USHRT_MAX_STRLEN); while ((offset + 2) <= offset_max_cat) { - g_snprintf(cat_str_tmp, USHRT_MAX_STRLEN, "%u", + snprintf(cat_str_tmp, USHRT_MAX_STRLEN, "%u", tvb_get_ntohs(tvb, offset)); offset += 2; if (cat_str[0] != '\0') @@ -1076,10 +1076,10 @@ dissect_ipopt_cipso(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * offset += 2; } if (cat_low != cat_high) - g_snprintf(cat_str_tmp, USHRT_MAX_STRLEN * 2, "%u-%u", + snprintf(cat_str_tmp, USHRT_MAX_STRLEN * 2, "%u-%u", cat_high, cat_low); else - g_snprintf(cat_str_tmp, USHRT_MAX_STRLEN * 2, "%u", cat_high); + snprintf(cat_str_tmp, USHRT_MAX_STRLEN * 2, "%u", cat_high); if (cat_str[0] != '\0') (void) g_strlcat(cat_str, ",", USHRT_MAX_STRLEN * 16); diff --git a/epan/dissectors/packet-ipars.c b/epan/dissectors/packet-ipars.c index 881c8e9fa5..4b3a4bbd8a 100644 --- a/epan/dissectors/packet-ipars.c +++ b/epan/dissectors/packet-ipars.c @@ -124,11 +124,11 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree, void* da proto_tree_add_protocol_format(ipars_tree, proto_ipars, tvb, 2, 2, "GoAhead IA: %2.2X", ia); ipars_eomtype = tvb_get_guint8(tvb, 4) & 0x3f; switch (ipars_eomtype) { - case EOMc: g_snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMc"); break; - case EOMi: g_snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMi"); break; - case EOMu: g_snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMu"); break; - case EOMpb: g_snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMpb"); break; - default: g_snprintf(eom_msg, MAX_EOM_MSG_SIZE, "Unknown EOM type (0x%2.2X)", ia); break; + case EOMc: snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMc"); break; + case EOMi: snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMi"); break; + case EOMu: snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMu"); break; + case EOMpb: snprintf(eom_msg, MAX_EOM_MSG_SIZE, "EOMpb"); break; + default: snprintf(eom_msg, MAX_EOM_MSG_SIZE, "Unknown EOM type (0x%2.2X)", ia); break; } proto_tree_add_protocol_format(ipars_tree, proto_ipars, tvb, 4, 1, "%s", eom_msg); proto_tree_add_protocol_format(ipars_tree, proto_ipars, tvb, 5, 1, "Good BCC"); diff --git a/epan/dissectors/packet-ipmi-picmg.c b/epan/dissectors/packet-ipmi-picmg.c index 6d5bc92171..df27d3caf3 100644 --- a/epan/dissectors/packet-ipmi-picmg.c +++ b/epan/dissectors/packet-ipmi-picmg.c @@ -888,7 +888,7 @@ parse_ipmb_state(proto_tree *tree, tvbuff_t *tvb, guint offs, int hf, int hf_lin if (!num) { desc = "All Links"; } else if (num < 0x60) { - g_snprintf(buf, sizeof(buf), "Link #%d", num); + snprintf(buf, sizeof(buf), "Link #%d", num); desc = buf; } else { desc = "Reserved"; @@ -977,7 +977,7 @@ parse_link_info_state(proto_tree *tree, tvbuff_t *tvb, guint offs, const char *n guint8 v = tvb_get_guint8(tvb, offs + 4); char buf[32]; - g_snprintf(buf, sizeof(buf), "Link info%s: ", num); + snprintf(buf, sizeof(buf), "Link info%s: ", num); proto_tree_add_bitmask_text(tree, tvb, offs, 4, buf, NULL, ett_ipmi_picmg_link_info, link_info, ENC_LITTLE_ENDIAN, 0); proto_tree_add_uint_format(tree, hf_ipmi_picmg_linkinfo_state, tvb, offs + 4, 1, @@ -1590,7 +1590,7 @@ static const value_string picmg_24_controls[] = { static void fmt_power_amps(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%dA", v / 10, v % 10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%dA", v / 10, v % 10); } /* Power Channel Control @@ -1698,7 +1698,7 @@ static const value_string cc28[] = { static void fmt_100ms(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%dS", v / 10, v % 10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%dS", v / 10, v % 10); } /* PM Heart-Beat diff --git a/epan/dissectors/packet-ipmi-transport.c b/epan/dissectors/packet-ipmi-transport.c index 7866e4ee5f..64cd4083c8 100644 --- a/epan/dissectors/packet-ipmi-transport.c +++ b/epan/dissectors/packet-ipmi-transport.c @@ -1582,10 +1582,10 @@ static void serial04_timeout_fmt(gchar *s, guint32 v) { if (v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d sec", 30 * v); + snprintf(s, ITEM_LABEL_LENGTH, "%d sec", 30 * v); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Does not timeout"); + snprintf(s, ITEM_LABEL_LENGTH, "Does not timeout"); } } @@ -2387,7 +2387,7 @@ static const value_string cc16[] = { static void tr17_fmt_blockno(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d%s", + snprintf(s, ITEM_LABEL_LENGTH, "%d%s", v, v ? "" : " (get received data length)"); } diff --git a/epan/dissectors/packet-ipmi.c b/epan/dissectors/packet-ipmi.c index 565182345f..3f6702357f 100644 --- a/epan/dissectors/packet-ipmi.c +++ b/epan/dissectors/packet-ipmi.c @@ -543,10 +543,10 @@ dissect_ipmi_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char str[ITEM_LABEL_LENGTH]; if (is_resp) { - g_snprintf(str, ITEM_LABEL_LENGTH, "Rsp, %s, %s", + snprintf(str, ITEM_LABEL_LENGTH, "Rsp, %s, %s", cmd->desc, cc_str); } else { - g_snprintf(str, ITEM_LABEL_LENGTH, "Req, %s", cmd->desc); + snprintf(str, ITEM_LABEL_LENGTH, "Req, %s", cmd->desc); } if (proto_registrar_get_ftype(hf_parent_item) == FT_STRING) { ti = proto_tree_add_string(tree, hf_parent_item, tvb, 0, -1, str); @@ -959,7 +959,7 @@ parse_8bit_ascii(char *p, tvbuff_t *tvb, guint offs, guint len) if (ch >= 0x20 && ch <= 0x7f) { *p++ = ch; } else { - g_snprintf(p, 5, "\\x%02x", ch); + snprintf(p, 5, "\\x%02x", ch); p += 4; } } @@ -991,7 +991,7 @@ parse_unicode(char *p, tvbuff_t *tvb, guint offs, guint len) while (p < pmax) { ch0 = tvb_get_guint8(tvb, offs++); ch1 = tvb_get_guint8(tvb, offs++); - g_snprintf(p, 7, "\\U%02x%02x", ch0, ch1); + snprintf(p, 7, "\\U%02x%02x", ch0, ch1); p += 6; } } @@ -1212,7 +1212,7 @@ ipmi_notimpl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) void ipmi_fmt_10ms_1based(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%03d seconds", v / 100, (v % 100) * 10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%03d seconds", v / 100, (v % 100) * 10); } void @@ -1224,7 +1224,7 @@ ipmi_fmt_500ms_0based(gchar *s, guint32 v) void ipmi_fmt_500ms_1based(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%03d seconds", v / 2, (v % 2) * 500); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%03d seconds", v / 2, (v % 2) * 500); } void @@ -1236,25 +1236,25 @@ ipmi_fmt_1s_0based(gchar *s, guint32 v) void ipmi_fmt_1s_1based(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", v); + snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", v); } void ipmi_fmt_2s_0based(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", (v + 1) * 2); + snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", (v + 1) * 2); } void ipmi_fmt_5s_1based(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", v * 5); + snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", v * 5); } void ipmi_fmt_version(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d", v & 0x0f, (v >> 4) & 0x0f); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d", v & 0x0f, (v >> 4) & 0x0f); } void @@ -1270,7 +1270,7 @@ ipmi_fmt_channel(gchar *s, guint32 v) gchar* tmp_str; tmp_str = val_to_str_wmem(NULL, v, chan_vals, "Channel #%d"); - g_snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%02x)", tmp_str, v); + snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%02x)", tmp_str, v); wmem_free(NULL, tmp_str); } @@ -1278,14 +1278,14 @@ void ipmi_fmt_udpport(gchar *s, guint32 v) { gchar* port_str = udp_port_to_display(NULL, v); - g_snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", port_str, v); + snprintf(s, ITEM_LABEL_LENGTH, "%s (%d)", port_str, v); wmem_free(NULL, port_str); } void ipmi_fmt_percent(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d%%", v); + snprintf(s, ITEM_LABEL_LENGTH, "%d%%", v); } const char * diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c index 9005d7aa1a..c159c46958 100644 --- a/epan/dissectors/packet-ipp.c +++ b/epan/dissectors/packet-ipp.c @@ -1500,7 +1500,7 @@ ipp_fmt_collection(tvbuff_t *tvb, int valoffset, char *buffer, int bufsize) static void ipp_fmt_version( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%u.%u", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } void diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 98bfbc78a6..e4bb40480e 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -813,7 +813,7 @@ get_full_ipv6_addr(char* ipv6_addr_expanded, char *ipv6_addr) break; addr_byte &= (0x0F << (4 * (i + 1) - mask)); addr_byte &= 0x0F; - g_snprintf(ipv6_addr_expanded + i, 4, "%X", addr_byte); + snprintf(ipv6_addr_expanded + i, 4, "%X", addr_byte); } } } @@ -897,9 +897,9 @@ get_full_ipv4_addr(char* ipv4_address_expanded, char *ipv4_address) return FALSE; if(addr_byte < 16) - g_snprintf(addr_byte_string,4,"0%X",addr_byte); + snprintf(addr_byte_string,4,"0%X",addr_byte); else - g_snprintf(addr_byte_string,4,"%X",addr_byte); + snprintf(addr_byte_string,4,"%X",addr_byte); for(i = 0; i < strlen(addr_byte_string); i++) { ipv4_address_expanded[cpt] = addr_byte_string[i]; @@ -926,9 +926,9 @@ get_full_ipv4_addr(char* ipv4_address_expanded, char *ipv4_address) return FALSE; if(addr_byte < 16) - g_snprintf(addr_byte_string,4,"0%X",addr_byte); + snprintf(addr_byte_string,4,"0%X",addr_byte); else - g_snprintf(addr_byte_string,4,"%X",addr_byte); + snprintf(addr_byte_string,4,"%X",addr_byte); for(i = 0; i < strlen(addr_byte_string); i++) { ipv4_address_expanded[cpt] = addr_byte_string[i]; @@ -968,7 +968,7 @@ get_full_ipv4_addr(char* ipv4_address_expanded, char *ipv4_address) return FALSE; addr_byte &= (0x0F << (4 * (i + 1) - mask)); addr_byte &= 0x0F; - g_snprintf(ipv4_address_expanded + i, 4, "%X", addr_byte); + snprintf(ipv4_address_expanded + i, 4, "%X", addr_byte); } } } @@ -1059,7 +1059,7 @@ filter_spi_match(guint spi, gchar *filter) if (strchr(filter, IPSEC_SA_WILDCARDS_ANY) != NULL) { gchar spi_string[IPSEC_SPI_LEN_MAX]; - g_snprintf(spi_string, IPSEC_SPI_LEN_MAX,"0x%08x", spi); + snprintf(spi_string, IPSEC_SPI_LEN_MAX,"0x%08x", spi); /* Lengths need to match exactly... */ if(strlen(spi_string) != filter_len) @@ -1184,7 +1184,7 @@ get_esp_sa(gint protocol_typ, gchar *src, gchar *dst, guint spi, static void ah_prompt(packet_info *pinfo, gchar *result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_ah, pinfo->curr_layer_num))); } diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index c1a0948ffd..6411ab504e 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -499,7 +499,7 @@ static void ipv6_prompt(packet_info *pinfo, gchar *result) { gpointer value = ipv6_value(pinfo); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", GPOINTER_TO_UINT(value)); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "IP protocol %u as", GPOINTER_TO_UINT(value)); } static const char* ipv6_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter) diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index 3980b1e1c3..a66224a1a7 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -3787,37 +3787,37 @@ dissect_life_duration(tvbuff_t *tvb, proto_tree *tree, proto_item *ti, int hf_ui guint64 val; val = tvb_get_ntoh40(tvb, offset); - proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" G_GINT64_MODIFIER "u", val); - proto_item_append_text(ti, ": %" G_GINT64_MODIFIER "u", val); + proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" PRIu64, val); + proto_item_append_text(ti, ": %" PRIu64, val); break; } case 6: { guint64 val; val = tvb_get_ntoh48(tvb, offset); - proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" G_GINT64_MODIFIER "u", val); - proto_item_append_text(ti, ": %" G_GINT64_MODIFIER "u", val); + proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" PRIu64, val); + proto_item_append_text(ti, ": %" PRIu64, val); break; } case 7: { guint64 val; val = tvb_get_ntoh56(tvb, offset); - proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" G_GINT64_MODIFIER "u", val); - proto_item_append_text(ti, ": %" G_GINT64_MODIFIER "u", val); + proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" PRIu64, val); + proto_item_append_text(ti, ": %" PRIu64, val); break; } case 8: { guint64 val; val = tvb_get_ntoh64(tvb, offset); - proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" G_GINT64_MODIFIER "u", val); - proto_item_append_text(ti, ": %" G_GINT64_MODIFIER "u", val); + proto_tree_add_uint64_format_value(tree, hf_uint64, tvb, offset, len, val, "%" PRIu64, val); + proto_item_append_text(ti, ": %" PRIu64, val); break; } default: proto_tree_add_item(tree, hf_bytes, tvb, offset, len, ENC_NA); - proto_item_append_text(ti, ": %" G_GINT64_MODIFIER "x ...", tvb_get_ntoh64(tvb, offset)); + proto_item_append_text(ti, ": %" PRIx64 " ...", tvb_get_ntoh64(tvb, offset)); break; } } diff --git a/epan/dissectors/packet-isobus-vt.c b/epan/dissectors/packet-isobus-vt.c index 9f12202daf..4e3c403606 100644 --- a/epan/dissectors/packet-isobus-vt.c +++ b/epan/dissectors/packet-isobus-vt.c @@ -1328,7 +1328,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio hf_isobus_vt_preferredassignment_auxinputunit_numberofpreferredfunctions, tvb, offset, 1, ENC_LITTLE_ENDIAN, &number_of_preferred_functions); offset += 1; - proto_item_set_text(input_unit_item, "Input Unit name 0x%" G_GINT64_MODIFIER "X model identification code %u", name, model_identification_code); + proto_item_set_text(input_unit_item, "Input Unit name 0x%" PRIX64 " model identification code %u", name, model_identification_code); proto_item_set_len(input_unit_item, 8 + 2 + 1 + ((2 + 2) * number_of_preferred_functions)); for(j = 0; j < number_of_preferred_functions; j++) @@ -1474,7 +1474,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio if(direction == ecu_to_vt) { - col_append_fstr(pinfo->cinfo, COL_INFO, "Assign %s of name 0x%" G_GINT64_MODIFIER "X to function %s", + col_append_fstr(pinfo->cinfo, COL_INFO, "Assign %s of name 0x%" PRIX64 " to function %s", get_object_id_string(auxiliary_input_object_id), name, get_object_id_string(auxiliary_function_object_id)); } else if(direction == vt_to_ecu) @@ -1630,7 +1630,7 @@ dissect_vt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, enum vt_directio hf_isobus_vt_auxiliarycapabilities_auxiliaryunit_numberofdifferentsets, tvb, offset, 1, ENC_LITTLE_ENDIAN, &number_of_different_sets); offset += 1; - proto_item_set_text(input_unit_item, "Auxiliary unit name 0x%" G_GINT64_MODIFIER "X", name); + proto_item_set_text(input_unit_item, "Auxiliary unit name 0x%" PRIX64, name); proto_item_set_len(input_unit_item, 8 + 1 + (3 * number_of_different_sets)); for(j = 0; j < number_of_different_sets; j++) diff --git a/epan/dissectors/packet-isobus.c b/epan/dissectors/packet-isobus.c index 8ffd4d4294..cb1fec5d5e 100644 --- a/epan/dissectors/packet-isobus.c +++ b/epan/dissectors/packet-isobus.c @@ -383,19 +383,19 @@ dissect_isobus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) proto_item_set_generated(ti); /* put source address in source field */ - g_snprintf(str_src, 4, "%d", src_addr); + snprintf(str_src, 4, "%d", src_addr); alloc_address_wmem(pinfo->pool, &pinfo->src, AT_STRINGZ, (int)strlen(str_src) + 1, str_src); if(pdu_format <= 239) /* PDU1 format */ { /* put destination address in address field */ - g_snprintf(str_dst, 4, "%d", pdu_specific); + snprintf(str_dst, 4, "%d", pdu_specific); alloc_address_wmem(pinfo->pool, &pinfo->dst, AT_STRINGZ, (int)strlen(str_dst) + 1, str_dst); } else { /* put group destination address in address field and add (grp) to it */ - g_snprintf(str_dst, 10, "%d (grp)", pdu_specific); + snprintf(str_dst, 10, "%d (grp)", pdu_specific); alloc_address_wmem(pinfo->pool, &pinfo->dst, AT_STRINGZ, (int)strlen(str_dst) + 1, str_dst); } diff --git a/epan/dissectors/packet-j1939.c b/epan/dissectors/packet-j1939.c index 61448467c4..6cf536f4b3 100644 --- a/epan/dissectors/packet-j1939.c +++ b/epan/dissectors/packet-j1939.c @@ -151,9 +151,9 @@ static void j1939_fmt_address(gchar *result, guint32 addr ) { if ((addr < 128) || (addr > 247)) - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (%s)", addr, val_to_str_ext_const(addr, &j1939_address_vals_ext, "Reserved")); + snprintf(result, ITEM_LABEL_LENGTH, "%d (%s)", addr, val_to_str_ext_const(addr, &j1939_address_vals_ext, "Reserved")); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%d (Arbitrary)", addr); + snprintf(result, ITEM_LABEL_LENGTH, "%d (Arbitrary)", addr); } static int dissect_j1939(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) diff --git a/epan/dissectors/packet-kafka.c b/epan/dissectors/packet-kafka.c index 095a7ad77d..329895f811 100644 --- a/epan/dissectors/packet-kafka.c +++ b/epan/dissectors/packet-kafka.c @@ -2427,7 +2427,7 @@ dissect_kafka_offset_fetch_response_partition(tvbuff_t *tvb, packet_info *pinfo, proto_item_append_text(ti, " (ID=%u, Offset=None)", packet_values.partition_id); } else { - proto_item_append_text(ti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", + proto_item_append_text(ti, " (ID=%u, Offset=%" PRIi64 ")", packet_values.partition_id, packet_values.offset); } @@ -3237,7 +3237,7 @@ dissect_kafka_fetch_request_partition(tvbuff_t *tvb, packet_info *pinfo, proto_t proto_tree_add_item(subtree, hf_kafka_max_bytes, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; - proto_item_append_text(ti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", + proto_item_append_text(ti, " (ID=%u, Offset=%" PRIi64 ")", packet_values.partition_id, packet_values.offset); return offset; @@ -3422,7 +3422,7 @@ dissect_kafka_fetch_response_partition(tvbuff_t *tvb, packet_info *pinfo, proto_ proto_item_set_end(ti, tvb, offset); - proto_item_append_text(ti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", + proto_item_append_text(ti, " (ID=%u, Offset=%" PRIi64 ")", packet_values.partition_id, packet_values.offset); return offset; @@ -3593,7 +3593,7 @@ dissect_kafka_produce_response_partition(tvbuff_t *tvb, packet_info *pinfo, prot proto_item_set_end(ti, tvb, offset); - proto_item_append_text(ti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", + proto_item_append_text(ti, " (ID=%u, Offset=%" PRIi64 ")", packet_values.partition_id, packet_values.offset); return offset; @@ -4260,7 +4260,7 @@ dissect_kafka_offset_commit_request_partition(tvbuff_t *tvb, packet_info *pinfo, } proto_item_set_end(subti, tvb, offset); - proto_item_append_text(subti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", + proto_item_append_text(subti, " (ID=%u, Offset=%" PRIi64 ")", partition_id, partition_offset); return offset; @@ -5703,7 +5703,7 @@ dissect_kafka_delete_records_request_topic_partition(tvbuff_t *tvb, packet_info if (partition_offset == -1) { proto_item_append_text(subti, " (ID=%u, Offset=HWM)", partition_id); } else { - proto_item_append_text(subti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", partition_id, partition_offset); + proto_item_append_text(subti, " (ID=%u, Offset=%" PRIi64 ")", partition_id, partition_offset); } return offset; @@ -5784,7 +5784,7 @@ dissect_kafka_delete_records_response_topic_partition(tvbuff_t *tvb, packet_info proto_item_set_end(subti, tvb, offset); if (partition_error_code == 0) { - proto_item_append_text(subti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", partition_id, partition_offset); + proto_item_append_text(subti, " (ID=%u, Offset=%" PRIi64 ")", partition_id, partition_offset); } else { proto_item_append_text(subti, " (ID=%u, Error=%s)", partition_id, kafka_error_to_str(partition_error_code)); } @@ -6335,7 +6335,7 @@ dissect_kafka_write_txn_markers_request_marker(tvbuff_t *tvb, packet_info *pinfo proto_item_set_end(subsubti, tvb, offset); proto_item_set_end(subti, tvb, offset); - proto_item_append_text(subti, " (Producer=%" G_GINT64_MODIFIER "u)", producer_id); + proto_item_append_text(subti, " (Producer=%" PRIu64 ")", producer_id); return offset; } @@ -6434,7 +6434,7 @@ dissect_kafka_write_txn_markers_response_marker(tvbuff_t *tvb, packet_info *pinf proto_item_set_end(subsubti, tvb, offset); proto_item_set_end(subti, tvb, offset); - proto_item_append_text(subti, " (Producer=%" G_GINT64_MODIFIER "u)", producer_id); + proto_item_append_text(subti, " (Producer=%" PRIu64 ")", producer_id); return offset; } @@ -6493,7 +6493,7 @@ dissect_kafka_txn_offset_commit_request_partition(tvbuff_t *tvb, packet_info *pi proto_item_set_end(subti, tvb, offset); - proto_item_append_text(subti, " (ID=%u, Offset=%" G_GINT64_MODIFIER "i)", partition_id, partition_offset); + proto_item_append_text(subti, " (ID=%u, Offset=%" PRIi64 ")", partition_id, partition_offset); return offset; } diff --git a/epan/dissectors/packet-kdp.c b/epan/dissectors/packet-kdp.c index 8672142d3e..3e8d417847 100644 --- a/epan/dissectors/packet-kdp.c +++ b/epan/dissectors/packet-kdp.c @@ -220,17 +220,17 @@ static int dissect_kdp(tvbuff_t *tvb, char src_flowid_string[BUFFER_SIZE]; if (packet_flags & KDP_ACK_FLAG) { - g_snprintf(ack_string, sizeof(ack_string), "ACK=%x ", ack_number); + snprintf(ack_string, sizeof(ack_string), "ACK=%x ", ack_number); } else { ack_string[0] = '\0'; } if (header_len > 4) { - g_snprintf(seq_num_string, sizeof(seq_num_string), "SEQ=%x ", sequence_number); + snprintf(seq_num_string, sizeof(seq_num_string), "SEQ=%x ", sequence_number); } else { seq_num_string[0] = '\0'; } if (packet_flags & (KDP_SYN_FLAG | KDP_BCST_FLAG)) { - g_snprintf(src_flowid_string, sizeof(src_flowid_string), "SRC_FLOWID=%x ", src_flowid); + snprintf(src_flowid_string, sizeof(src_flowid_string), "SRC_FLOWID=%x ", src_flowid); } else { src_flowid_string[0] = '\0'; } diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c index 569c46b238..4ab0fb432b 100644 --- a/epan/dissectors/packet-kink.c +++ b/epan/dissectors/packet-kink.c @@ -833,7 +833,7 @@ kink_fmt_version( gchar *result, guint32 version ) major_version = (guint8)((version & FRONT_FOUR_BIT) >> VERSION_BIT_SHIFT); minor_version = (guint8)(version & SECOND_FOUR_BIT); - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", major_version, minor_version); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", major_version, minor_version); } /* Output part */ diff --git a/epan/dissectors/packet-knxip.c b/epan/dissectors/packet-knxip.c index f4e715ceea..7ced80e166 100644 --- a/epan/dissectors/packet-knxip.c +++ b/epan/dissectors/packet-knxip.c @@ -593,7 +593,7 @@ static proto_item* knxip_tree_add_ip_address( proto_tree* tree, tvbuff_t* tvb, g if( output ) { const guint8* ipa = tvb_get_ptr( tvb, offset, 4 ); - g_snprintf( output, output_max, "%u.%u.%u.%u", ipa[ 0 ], ipa[ 1 ], ipa[ 2 ], ipa[ 3 ] ); + snprintf( output, output_max, "%u.%u.%u.%u", ipa[ 0 ], ipa[ 1 ], ipa[ 2 ], ipa[ 3 ] ); } return proto_tree_add_item( tree, hf_knxip_ip_address, tvb, offset, 4, ENC_BIG_ENDIAN ); } @@ -602,8 +602,8 @@ static proto_item* knxip_tree_add_knx_address( proto_tree* tree, gint hfindex, t { guint16 value = tvb_get_ntohs( tvb, offset ); gchar text[ 32 ]; - g_snprintf( text, sizeof text, "%u.%u.%u", (value >> 12) & 0xF, (value >> 8) & 0xF, value & 0xFF ); - if( output ) g_snprintf( output, output_max, "%s", text ); + snprintf( text, sizeof text, "%u.%u.%u", (value >> 12) & 0xF, (value >> 8) & 0xF, value & 0xFF ); + if( output ) snprintf( output, output_max, "%s", text ); proto_item* new_item = proto_tree_add_item( tree, hfindex, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_item_append_text( new_item, " = %s", text ); return new_item; @@ -620,11 +620,11 @@ static proto_item* knxip_tree_add_bit( proto_tree* tree, tvbuff_t* tvb, gint off if( *output ) { do { ++output; --output_max; } while( *output ); - g_snprintf( output, output_max, " | " ); + snprintf( output, output_max, " | " ); while( *output ) { ++output; --output_max; } } - g_snprintf( output, output_max, "%s", name ); + snprintf( output, output_max, "%s", name ); } return proto_tree_add_bytes_format( tree, hf_bytes, tvb, offset, 1, NULL, format, name, value ); @@ -659,7 +659,7 @@ static guint8 dissect_hpai( tvbuff_t* tvb, packet_info* pinfo, proto_item* item, gchar info[ 80 ]; gchar* output = info; gint output_max = sizeof info; - g_snprintf( info, sizeof info, "???" ); + snprintf( info, sizeof info, "???" ); if( struct_len <= 0 ) { @@ -765,7 +765,7 @@ static guint8 dissect_hpai( tvbuff_t* tvb, packet_info* pinfo, proto_item* item, while( *output ) { ++output; --output_max; } if( output_max > 1 ) { *output++ = ':'; --output_max; } - g_snprintf( output, output_max, "???" ); + snprintf( output, output_max, "???" ); if( struct_len < 8 ) { @@ -777,7 +777,7 @@ static guint8 dissect_hpai( tvbuff_t* tvb, packet_info* pinfo, proto_item* item, /* 2 bytes Port Number */ guint16 port = tvb_get_ntohs( tvb, offset ); - g_snprintf( output, output_max, "%u", port ); + snprintf( output, output_max, "%u", port ); while( *output ) { ++output; --output_max; } node = proto_tree_add_item( hpai_tree, hf_knxip_port, tvb, offset, 2, ENC_BIG_ENDIAN ); @@ -1136,7 +1136,7 @@ static guint8 dissect_cnhdr( tvbuff_t* tvb, packet_info* pinfo, proto_item* item *output++ = '#'; output_max--; - g_snprintf( output, output_max, "???" ); + snprintf( output, output_max, "???" ); if( struct_len <= 0 ) { @@ -1179,9 +1179,9 @@ static guint8 dissect_cnhdr( tvbuff_t* tvb, packet_info* pinfo, proto_item* item } else { - g_snprintf( output, output_max, "%02X:", tvb_get_guint8( tvb, offset ) ); + snprintf( output, output_max, "%02X:", tvb_get_guint8( tvb, offset ) ); while( *output ) { ++output; --output_max; } - g_snprintf( output, output_max, "???" ); + snprintf( output, output_max, "???" ); proto_tree_add_item( cnhdr_tree, hf_knxip_channel, tvb, offset, 1, ENC_BIG_ENDIAN ); offset++; @@ -1193,7 +1193,7 @@ static guint8 dissect_cnhdr( tvbuff_t* tvb, packet_info* pinfo, proto_item* item } else { - g_snprintf( output, output_max, "%u", tvb_get_guint8( tvb, offset ) ); + snprintf( output, output_max, "%u", tvb_get_guint8( tvb, offset ) ); while( *output ) { ++output; --output_max; } proto_tree_add_item( cnhdr_tree, hf_knxip_seq_counter, tvb, offset, 1, ENC_BIG_ENDIAN ); @@ -1205,7 +1205,7 @@ static guint8 dissect_cnhdr( tvbuff_t* tvb, packet_info* pinfo, proto_item* item { *output++ = ' '; output_max--; - g_snprintf( output, output_max, "???" ); + snprintf( output, output_max, "???" ); } } @@ -1218,7 +1218,7 @@ static guint8 dissect_cnhdr( tvbuff_t* tvb, packet_info* pinfo, proto_item* item { if( response ) { - g_snprintf( output, output_max, "%s", val_to_str( tvb_get_guint8( tvb, offset ), error_vals, "Error 0x%02x" ) ); + snprintf( output, output_max, "%s", val_to_str( tvb_get_guint8( tvb, offset ), error_vals, "Error 0x%02x" ) ); knxip_tree_add_status( cnhdr_tree, tvb, offset ); } else @@ -1373,7 +1373,7 @@ static guint8 dissect_routing_loss( tvbuff_t* tvb, packet_info* pinfo, proto_ite proto_item* info_item = proto_tree_add_none_format( tree, hf_folder, tvb, offset, struct_len, "Loss Info" ); gchar info[ 16 ]; - g_snprintf( info, sizeof info, "???" ); + snprintf( info, sizeof info, "???" ); if( struct_len <= 0 ) { @@ -1418,7 +1418,7 @@ static guint8 dissect_routing_loss( tvbuff_t* tvb, packet_info* pinfo, proto_ite if( struct_len >= 4 ) { guint16 loss = tvb_get_ntohs( tvb, offset ); - g_snprintf( info, sizeof info, "%u", loss ); + snprintf( info, sizeof info, "%u", loss ); proto_tree_add_item( info_tree, hf_knxip_routing_loss, tvb, offset, 2, ENC_BIG_ENDIAN ); offset += 2; } @@ -1457,7 +1457,7 @@ static guint8 dissect_routing_busy( tvbuff_t* tvb, packet_info* pinfo, proto_ite proto_item* info_item = proto_tree_add_none_format( tree, hf_folder, tvb, offset, eff_struct_len, "Busy Info" ); gchar info[ 16 ]; - g_snprintf( info, sizeof info, "???" ); + snprintf( info, sizeof info, "???" ); if( struct_len <= 0 ) { @@ -1503,7 +1503,7 @@ static guint8 dissect_routing_busy( tvbuff_t* tvb, packet_info* pinfo, proto_ite /* 2 bytes Wait Time (ms) */ proto_item* new_item = proto_tree_add_item( info_tree, hf_knxip_busy_time, tvb, offset, 2, ENC_BIG_ENDIAN ); proto_item_append_text( new_item, " ms" ); - g_snprintf( info, sizeof info, "%u ms", tvb_get_ntohs( tvb, offset ) ); + snprintf( info, sizeof info, "%u ms", tvb_get_ntohs( tvb, offset ) ); offset += 2; if( struct_len >= 6 ) @@ -1548,7 +1548,7 @@ static guint8 dissect_selector( tvbuff_t* tvb, packet_info* pinfo, proto_item* i proto_item* info_item = proto_tree_add_none_format( tree, hf_folder, tvb, offset, eff_struct_len, "Selector" ); gchar info[ 40 ]; - g_snprintf( info, sizeof info, "???" ); + snprintf( info, sizeof info, "???" ); if( struct_len <= 0 ) { @@ -1590,7 +1590,7 @@ static guint8 dissect_selector( tvbuff_t* tvb, packet_info* pinfo, proto_item* i if( sel == SELECT_PROGMODE ) { - g_snprintf( info, sizeof info, "ProgMode" ); + snprintf( info, sizeof info, "ProgMode" ); if( struct_len != 2 ) { @@ -1603,9 +1603,9 @@ static guint8 dissect_selector( tvbuff_t* tvb, packet_info* pinfo, proto_item* i { gchar* output = info; gint output_max = sizeof info; - g_snprintf( output, output_max, "MAC=" ); + snprintf( output, output_max, "MAC=" ); while( *output ) { ++output; --output_max; } - g_snprintf( output, output_max, "???" ); + snprintf( output, output_max, "???" ); if( struct_len != 8 ) { @@ -1619,7 +1619,7 @@ static guint8 dissect_selector( tvbuff_t* tvb, packet_info* pinfo, proto_item* i /* 6 bytes MAC Address */ guint8 mac[ 6 ]; tvb_memcpy( tvb, mac, offset, 6 ); - g_snprintf( output, output_max, "%02x:%02x:%02x:%02x:%02x:%02x", mac[ 0 ], mac[ 1 ], mac[ 2 ], mac[ 3 ], mac[ 4 ], mac[ 5 ] ); + snprintf( output, output_max, "%02x:%02x:%02x:%02x:%02x:%02x", mac[ 0 ], mac[ 1 ], mac[ 2 ], mac[ 3 ], mac[ 4 ], mac[ 5 ] ); proto_tree_add_item( info_tree, hf_knxip_mac_address, tvb, offset, 6, ENC_NA ); offset += 6; } @@ -1881,7 +1881,7 @@ static guint8 dissect_dib_ipconfig( tvbuff_t* tvb, packet_info* pinfo, if( struct_len < 6 ) { - g_snprintf( text, sizeof text, "???" ); + snprintf( text, sizeof text, "???" ); } else { @@ -1942,7 +1942,7 @@ static guint8 dissect_dib_curconfig( tvbuff_t* tvb, packet_info* pinfo, if( struct_len < 6 ) { - g_snprintf( text, sizeof text, "???" ); + snprintf( text, sizeof text, "???" ); } else { @@ -2006,7 +2006,7 @@ static guint8 dissect_dib_knxaddr( tvbuff_t* tvb, packet_info* pinfo, if( struct_len < 4 ) { if( length_ok ) knxip_item_illegal_length( length_item, pinfo, "Expected: >= 4 bytes" ); - g_snprintf( text1, sizeof text1, "???" ); + snprintf( text1, sizeof text1, "???" ); ok = 0; } else @@ -2218,13 +2218,13 @@ static guint8 dissect_dib_mfrdata( tvbuff_t* tvb, packet_info* pinfo, if( struct_len < 4 ) { if( length_ok ) knxip_item_illegal_length( length_item, pinfo, "Expected: >= 4 bytes" ); - g_snprintf( text, sizeof text, "???" ); + snprintf( text, sizeof text, "???" ); ok = 0; } else { proto_tree_add_item( dib_tree, hf_knxip_manufacturer_code, tvb, offset, 2, ENC_BIG_ENDIAN ); - g_snprintf( text, sizeof text, "0x%04x", tvb_get_ntohs( tvb, offset ) ); + snprintf( text, sizeof text, "0x%04x", tvb_get_ntohs( tvb, offset ) ); offset += 2; } @@ -2618,23 +2618,23 @@ static void make_key_info( gchar* text, gint text_max, const guint8* key, const if( !key ) { - g_snprintf( text, text_max, "without key" ); + snprintf( text, text_max, "without key" ); } else { if( context ) { - g_snprintf( text, text_max, "with %s key", context ); + snprintf( text, text_max, "with %s key", context ); } else { - g_snprintf( text, text_max, "with key" ); + snprintf( text, text_max, "with key" ); } for( count = 16; count; --count ) { while( *text ) { ++text; --text_max; } - g_snprintf( text, text_max, " %02X", *key++ ); + snprintf( text, text_max, " %02X", *key++ ); } } } @@ -3824,7 +3824,7 @@ static gint dissect_knxip( tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, { /* 1 byte Protocol Version */ protocol_version = tvb_get_guint8( tvb, 1 ); - g_snprintf( version_info, sizeof version_info, "%u.%u", hi_nibble( protocol_version ), lo_nibble( protocol_version ) ); + snprintf( version_info, sizeof version_info, "%u.%u", hi_nibble( protocol_version ), lo_nibble( protocol_version ) ); if( tree ) { diff --git a/epan/dissectors/packet-knxip_decrypt.c b/epan/dissectors/packet-knxip_decrypt.c index 4eaba15a04..c881233eee 100644 --- a/epan/dissectors/packet-knxip_decrypt.c +++ b/epan/dissectors/packet-knxip_decrypt.c @@ -297,7 +297,7 @@ static void decrypt_key( guint8 key[] _U_, guint8 password_hash[] _U_, guint8 cr static void decode_and_decrypt_key( guint8 key[ BASE64_KNX_KEY_LENGTH + 1 ], const gchar* text, guint8 password_hash[], guint8 created_hash[] ) { gsize out_len; - g_snprintf( (gchar*) key, BASE64_KNX_KEY_LENGTH + 1, "%s", text ); + snprintf( (gchar*) key, BASE64_KNX_KEY_LENGTH + 1, "%s", text ); g_base64_decode_inplace( (gchar*) key, &out_len ); decrypt_key( key, password_hash, created_hash ); } @@ -503,7 +503,7 @@ static void add_ia_seq( guint16 ia, const gchar* text, FILE* f2 ) if( f2 ) { - fprintf( f2, "IA %u.%u.%u SeqNr %" G_GINT64_MODIFIER "u\n", (ia >> 12) & 0xF, (ia >> 8) & 0xF, ia & 0xFF, seq ); + fprintf( f2, "IA %u.%u.%u SeqNr %" PRIu64 "\n", (ia >> 12) & 0xF, (ia >> 8) & 0xF, ia & 0xFF, seq ); } ia_seq = wmem_new(wmem_epan_scope(), struct knx_keyring_ia_seqs); @@ -637,7 +637,7 @@ void read_knx_keyring_xml_file( const gchar* key_file, const gchar* password, co if( !tag_name_done ) // tag name { - g_snprintf( tag_name, sizeof tag_name, "%s", name ); + snprintf( tag_name, sizeof tag_name, "%s", name ); *name = '\0'; tag_name_done = 1; } diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c index 207df7ab00..929c5ff84a 100644 --- a/epan/dissectors/packet-l2tp.c +++ b/epan/dissectors/packet-l2tp.c @@ -1486,7 +1486,7 @@ static void update_session(l2tpv3_tunnel_t *tunnel, l2tpv3_session_t *session) static void l2tp_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode L2TPv3 packet type 0x%04x as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode L2TPv3 packet type 0x%04x as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_l2tp, 0))); } diff --git a/epan/dissectors/packet-lapsat.c b/epan/dissectors/packet-lapsat.c index 2cd68f5c7a..f94e6b4104 100644 --- a/epan/dissectors/packet-lapsat.c +++ b/epan/dissectors/packet-lapsat.c @@ -272,7 +272,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int is_ break; } - g_snprintf(info, 80, "S%s, func=%s, N(R)=%u", + snprintf(info, 80, "S%s, func=%s, N(R)=%u", poll_final ? (is_response ? " F" : " P") : "", frame_type, (ctl & LAPSAT_CTL_N_R_MSK) >> LAPSAT_CTL_N_R_SHIFT); @@ -305,7 +305,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int is_ break; } - g_snprintf(info, 80, "U%s, func=%s", + snprintf(info, 80, "U%s, func=%s", poll_final ? (is_response ? " F" : " P") : "", frame_type); @@ -315,7 +315,7 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int is_ /* * Information frame */ - g_snprintf(info, 80, "I%s, N(R)=%u, N(S)=%u", + snprintf(info, 80, "I%s, N(R)=%u, N(S)=%u", poll_final ? " P" : "", (ctl & LAPSAT_CTL_N_R_MSK) >> LAPSAT_CTL_N_R_SHIFT, (ctl & LAPSAT_CTL_N_S_MSK) >> LAPSAT_CTL_N_S_SHIFT); diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c index 8573541601..50c062437b 100644 --- a/epan/dissectors/packet-lbmc.c +++ b/epan/dissectors/packet-lbmc.c @@ -6150,24 +6150,24 @@ lbm_uim_seq_analysis_packet(void *ptr, packet_info *pinfo, epan_dissect_t *edt _ if (stream_info->description == NULL) { - sai->frame_label = g_strdup_printf("(%" G_GUINT32_FORMAT ")", stream_info->sqn); + sai->frame_label = g_strdup_printf("(%" PRIu32 ")", stream_info->sqn); } else { - sai->frame_label = g_strdup_printf("%s (%" G_GUINT32_FORMAT ")", stream_info->description, stream_info->sqn); + sai->frame_label = g_strdup_printf("%s (%" PRIu32 ")", stream_info->description, stream_info->sqn); } if (epa.type == lbm_uim_instance_stream) { ctxinst1 = bytes_to_str(pinfo->pool, epa.stream_info.ctxinst.ctxinst, sizeof(epa.stream_info.ctxinst.ctxinst)); ctxinst2 = bytes_to_str(pinfo->pool, epb.stream_info.ctxinst.ctxinst, sizeof(epb.stream_info.ctxinst.ctxinst)); - sai->comment = g_strdup_printf("%s <-> %s [%" G_GUINT64_FORMAT "]", + sai->comment = g_strdup_printf("%s <-> %s [%" PRIu64 "]", ctxinst1, ctxinst2, stream_info->channel); } else { - sai->comment = g_strdup_printf("%" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " <-> %" G_GUINT32_FORMAT ":%s:%" G_GUINT16_FORMAT " [%" G_GUINT64_FORMAT "]", + sai->comment = g_strdup_printf("%" PRIu32 ":%s:%" PRIu16 " <-> %" PRIu32 ":%s:%" PRIu16 " [%" PRIu64 "]", epa.stream_info.dest.domain, address_to_str(pinfo->pool, &(epa.stream_info.dest.addr)), epa.stream_info.dest.port, @@ -10169,7 +10169,7 @@ static int dissect_nhdr_extopt(tvbuff_t * tvb, int offset, packet_info * pinfo, reassembly->len = 0; if (fragment_offset != 0) { - expert_add_info_format(pinfo, NULL, &ei_lbmc_analysis_no_reassembly, "LBMC EXTOPT: reassembly not in progress but fragment_offset not zero (%" G_GUINT16_FORMAT ")", fragment_offset); + expert_add_info_format(pinfo, NULL, &ei_lbmc_analysis_no_reassembly, "LBMC EXTOPT: reassembly not in progress but fragment_offset not zero (%" PRIu16 ")", fragment_offset); } else { @@ -11443,7 +11443,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr { /* Indicate a malformed packet */ expert_add_info_format(pinfo, NULL, &ei_lbmc_analysis_invalid_fragment, - "Invalid fragment for message (msglen=%" G_GUINT32_FORMAT ", frag offset=%" G_GUINT32_FORMAT ", frag len=%d", + "Invalid fragment for message (msglen=%" PRIu32 ", frag offset=%" PRIu32 ", frag len=%d", msg->total_len, frag_info.offset, frag_len); } else @@ -11536,7 +11536,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr data_tvb, 0, tvb_reported_length_remaining(data_tvb, 0), - "%" G_GUINT32_FORMAT " Reassembled Fragments (%" G_GUINT32_FORMAT " bytes):", + "%" PRIu32 " Reassembled Fragments (%" PRIu32 " bytes):", msg->fragment_count, msg->total_len); frag_tree = proto_item_add_subtree(frag_item, ett_lbmc_reassembly); @@ -11550,7 +11550,7 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr cur->fragment_start, cur->fragment_len, cur->frame, - "Frame: %" G_GUINT32_FORMAT ", payload: %" G_GUINT32_FORMAT "-%" G_GUINT32_FORMAT " (%" G_GUINT32_FORMAT " bytes)", + "Frame: %" PRIu32 ", payload: %" PRIu32 "-%" PRIu32 " (%" PRIu32 " bytes)", cur->frame, cur->fragment_start, (cur->fragment_start + cur->fragment_len) - 1, @@ -11558,11 +11558,11 @@ int lbmc_dissect_lbmc_packet(tvbuff_t * tvb, int offset, packet_info * pinfo, pr proto_item_set_generated(pi); if (first_item) { - proto_item_append_text(frag_item, " #%" G_GUINT32_FORMAT "(%" G_GUINT32_FORMAT ")", cur->frame, cur->fragment_len); + proto_item_append_text(frag_item, " #%" PRIu32 "(%" PRIu32 ")", cur->frame, cur->fragment_len); } else { - proto_item_append_text(frag_item, ", #%" G_GUINT32_FORMAT "(%" G_GUINT32_FORMAT ")", cur->frame, cur->fragment_len); + proto_item_append_text(frag_item, ", #%" PRIu32 "(%" PRIu32 ")", cur->frame, cur->fragment_len); } first_item = FALSE; cur = cur->next; diff --git a/epan/dissectors/packet-lbmpdm.c b/epan/dissectors/packet-lbmpdm.c index d72af1e1f4..8689aa88ac 100644 --- a/epan/dissectors/packet-lbmpdm.c +++ b/epan/dissectors/packet-lbmpdm.c @@ -596,7 +596,7 @@ static void dissect_field_value(tvbuff_t * tvb, int offset, proto_tree * tree, g shift_count--; } proto_tree_add_none_format(tree, hf_lbmpdm_field_value_decimal, tvb, offset, field_length, - "DECIMAL Value: %" G_GINT64_FORMAT " (%" G_GINT64_FORMAT "e%d)", whole, mantissa, exponent); + "DECIMAL Value: %" PRId64 " (%" PRId64 "e%d)", whole, mantissa, exponent); } else { @@ -623,7 +623,7 @@ static void dissect_field_value(tvbuff_t * tvb, int offset, proto_tree * tree, g whole *= -1; } proto_tree_add_none_format(tree, hf_lbmpdm_field_value_decimal, tvb, offset, field_length, - "DECIMAL Value: %" G_GINT64_FORMAT ".%0*" G_GUINT64_FORMAT " (%" G_GINT64_FORMAT "e%d)", + "DECIMAL Value: %" PRId64 ".%0*" PRIu64 " (%" PRId64 "e%d)", whole, decimal_digits, fraction, mantissa, exponent); } } diff --git a/epan/dissectors/packet-lbmr.c b/epan/dissectors/packet-lbmr.c index ae13db17e9..3ba36e348f 100644 --- a/epan/dissectors/packet-lbmr.c +++ b/epan/dissectors/packet-lbmr.c @@ -102,7 +102,7 @@ static lbtipc_transport_t * lbtipc_transport_add(guint32 host_id, guint32 sessio static char * lbtipc_transport_source_string(guint32 host_id _U_, guint32 session_id, guint16 xport_id) { - return (wmem_strdup_printf(wmem_file_scope(), "LBT-IPC:%x:%" G_GUINT16_FORMAT, session_id, xport_id)); + return (wmem_strdup_printf(wmem_file_scope(), "LBT-IPC:%x:%" PRIu16, session_id, xport_id)); } /*----------------------------------------------------------------------------*/ @@ -175,7 +175,7 @@ static lbtsmx_transport_t * lbtsmx_transport_add(guint32 host_id, guint32 sessio static char * lbtsmx_transport_source_string(guint32 host_id _U_, guint32 session_id, guint16 xport_id) { - return (wmem_strdup_printf(wmem_file_scope(), "LBT-SMX:%x:%" G_GUINT16_FORMAT, session_id, xport_id)); + return (wmem_strdup_printf(wmem_file_scope(), "LBT-SMX:%x:%" PRIu16, session_id, xport_id)); } /*----------------------------------------------------------------------------*/ @@ -255,7 +255,7 @@ static lbtrdma_transport_t * lbtrdma_transport_add(const address * source_addres static char * lbtrdma_transport_source_string(const address * source_address _U_, guint32 session_id, guint16 port) { - return (wmem_strdup_printf(wmem_file_scope(), "LBT-RDMA:%x:%" G_GUINT16_FORMAT, session_id, port)); + return (wmem_strdup_printf(wmem_file_scope(), "LBT-RDMA:%x:%" PRIu16, session_id, port)); } /*----------------------------------------------------------------------------*/ @@ -2853,7 +2853,7 @@ static tap_packet_status lbmr_topic_ads_topic_stats_tree_packet(stats_tree * tre tick_stat_node(tree, lbmr_stat_tree_name_topic_ads_topic, 0, FALSE); topic_node = tick_stat_node(tree, info->topic, lbmr_stats_tree_handle_topic_ads_topic, TRUE); source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), topic_node, TRUE); - full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" G_GUINT32_FORMAT "]", info->source, info->topic_index); + full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" PRIu32 "]", info->source, info->topic_index); tick_stat_node(tree, full_source_string, source_node, TRUE); return (TAP_PACKET_REDRAW); } @@ -2880,7 +2880,7 @@ static tap_packet_status lbmr_topic_ads_source_stats_tree_packet(stats_tree * tr tick_stat_node(tree, lbmr_stat_tree_name_topic_ads_source, 0, FALSE); source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_topic_ads_source, TRUE); topic_node = tick_stat_node(tree, info->topic, source_node, TRUE); - full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" G_GUINT32_FORMAT "]", info->source, info->topic_index); + full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" PRIu32 "]", info->source, info->topic_index); tick_stat_node(tree, full_source_string, topic_node, TRUE); return (TAP_PACKET_REDRAW); } @@ -2904,7 +2904,7 @@ static tap_packet_status lbmr_topic_ads_transport_stats_tree_packet(stats_tree * tick_stat_node(tree, lbmr_stat_tree_name_topic_ads_transport, 0, FALSE); transport_node = tick_stat_node(tree, info->source, lbmr_stats_tree_handle_topic_ads_transport, TRUE); - full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s [%" G_GUINT32_FORMAT "]", info->topic, info->topic_index); + full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s [%" PRIu32 "]", info->topic, info->topic_index); tick_stat_node(tree, full_source_string, transport_node, TRUE); return (TAP_PACKET_REDRAW); } @@ -3024,7 +3024,7 @@ static tap_packet_status lbmr_queue_ads_queue_stats_tree_packet(stats_tree * tre tick_stat_node(tree, lbmr_stat_tree_name_queue_ads_queue, 0, FALSE); queue_node = tick_stat_node(tree, info->queue, lbmr_stats_tree_handle_queue_ads_queue, TRUE); - str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), &pinfo->net_src), info->port); + str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" PRIu16, address_to_str(wmem_packet_scope(), &pinfo->net_src), info->port); tick_stat_node(tree, str, queue_node, TRUE); return (TAP_PACKET_REDRAW); } @@ -3048,7 +3048,7 @@ static tap_packet_status lbmr_queue_ads_source_stats_tree_packet(stats_tree * tr tick_stat_node(tree, lbmr_stat_tree_name_queue_ads_source, 0, FALSE); source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_queue_ads_source, TRUE); - str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" G_GUINT16_FORMAT, info->queue, info->port); + str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" PRIu16, info->queue, info->port); tick_stat_node(tree, str, source_node, TRUE); return (TAP_PACKET_REDRAW); } @@ -3460,7 +3460,7 @@ static int dissect_lbmr_tmr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, } break; } - ti = proto_tree_add_none_format(tree, hf_lbmr_tmr, tvb, offset, tmr_len, "%s: %s%s, Length %" G_GUINT16_FORMAT, + ti = proto_tree_add_none_format(tree, hf_lbmr_tmr, tvb, offset, tmr_len, "%s: %s%s, Length %" PRIu16, name, val_to_str(tmr_type, lbmr_tmr_type, "Unknown (0x%02x)"), info_string, tmr_len); tinfo_tree = proto_item_add_subtree(ti, ett_lbmr_tmr); proto_tree_add_item(tinfo_tree, hf_lbmr_tmr_len, tvb, offset + O_LBMR_TMR_T_LEN, L_LBMR_TMR_T_LEN, ENC_BIG_ENDIAN); @@ -4121,7 +4121,7 @@ static int dissect_lbmr_tir_entry(tvbuff_t * tvb, int offset, packet_info * pinf reclen += L_LBMR_TIR_T; curr_offset += L_LBMR_TIR_T; - ti = proto_tree_add_none_format(tree, hf_lbmr_tir, tvb, offset, reclen, "%s: %s, Length %u, Index %" G_GUINT32_FORMAT ", TTL %" G_GUINT16_FORMAT, + ti = proto_tree_add_none_format(tree, hf_lbmr_tir, tvb, offset, reclen, "%s: %s, Length %u, Index %" PRIu32 ", TTL %" PRIu16, name, val_to_str((transport & LBMR_TIR_TRANSPORT), lbmr_transport_type, "Unknown (0x%02x)"), tlen, idx, ttl); tinfo_tree = proto_item_add_subtree(ti, ett_lbmr_tir); proto_tree_add_item(tinfo_tree, hf_lbmr_tir_name, tvb, offset, namelen, ENC_ASCII|ENC_NA); @@ -4231,7 +4231,7 @@ static int dissect_lbmr_qir_grp_blk(tvbuff_t * tvb, int offset, packet_info * pi idx = tvb_get_ntohs(tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_IDX); sz = tvb_get_ntohs(tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_SZ); - ti = proto_tree_add_none_format(tree, hf_lbmr_qir_grp_blk, tvb, offset, L_LBMR_QIR_GRP_BLK_T, "Group block, Index %" G_GUINT16_FORMAT ", Size %" G_GUINT16_FORMAT, idx, sz); + ti = proto_tree_add_none_format(tree, hf_lbmr_qir_grp_blk, tvb, offset, L_LBMR_QIR_GRP_BLK_T, "Group block, Index %" PRIu16 ", Size %" PRIu16, idx, sz); blk_tree = proto_item_add_subtree(ti, ett_lbmr_qir_grp_blk); proto_tree_add_item(blk_tree, hf_lbmr_qir_grp_blk_grp_idx, tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_IDX, L_LBMR_QIR_GRP_BLK_T_GRP_IDX, ENC_BIG_ENDIAN); proto_tree_add_item(blk_tree, hf_lbmr_qir_grp_blk_grp_sz, tvb, offset + O_LBMR_QIR_GRP_BLK_T_GRP_SZ, L_LBMR_QIR_GRP_BLK_T_GRP_SZ, ENC_BIG_ENDIAN); @@ -4286,7 +4286,7 @@ static int dissect_lbmr_qir_entry(tvbuff_t * tvb, int offset, packet_info * pinf grp_blks = have_options & LBMR_QIR_GRP_BLOCKS_MASK; have_options &= LBMR_QIR_OPTIONS; queue_blks = tvb_get_ntohs(tvb, curr_offset + O_LBMR_QIR_T_QUEUE_BLKS); - qirti = proto_tree_add_none_format(tree, hf_lbmr_qir, tvb, offset, reclen, "%s: %s, ID %" G_GUINT32_FORMAT, qname, tname, queue_id); + qirti = proto_tree_add_none_format(tree, hf_lbmr_qir, tvb, offset, reclen, "%s: %s, ID %" PRIu32, qname, tname, queue_id); qirtree = proto_item_add_subtree(qirti, ett_lbmr_qir); proto_tree_add_item(qirtree, hf_lbmr_qir_queue_name, tvb, qnameoffset, qnamelen, ENC_ASCII|ENC_NA); proto_tree_add_item(qirtree, hf_lbmr_qir_topic_name, tvb, tnameoffset, tnamelen, ENC_ASCII|ENC_NA); @@ -5274,7 +5274,7 @@ static int dissect_lbmr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, switch (type) { case LBMR_HDR_TYPE_QUEUE_RES: - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "QQRs %u QIRs %" G_GUINT16_FORMAT, tqrs, tirs); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "QQRs %u QIRs %" PRIu16, tqrs, tirs); break; default: if (rd_keepalive) @@ -5298,7 +5298,7 @@ static int dissect_lbmr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, } else { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TQRs %u TIRs %" G_GUINT16_FORMAT, tqrs, tirs); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TQRs %u TIRs %" PRIu16, tqrs, tirs); } break; } @@ -5308,12 +5308,12 @@ static int dissect_lbmr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, case LBMR_HDR_TYPE_QUEUE_RES: if (tag_name != NULL) { - ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) QQRs %u, QIRs %" G_GUINT16_FORMAT, + ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) QQRs %u, QIRs %" PRIu16, tag_name, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs); } else { - ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) QQRs %u, QIRs %" G_GUINT16_FORMAT, + ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) QQRs %u, QIRs %" PRIu16, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs); } break; @@ -5332,7 +5332,7 @@ static int dissect_lbmr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, } else { - ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) TQRs %u, TIRs %" G_GUINT16_FORMAT, + ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol (Tag: %s): Version %u, Type 0x%x (%s) TQRs %u, TIRs %" PRIu16, tag_name, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs); } } @@ -5350,7 +5350,7 @@ static int dissect_lbmr(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, } else { - ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) TQRs %u, TIRs %" G_GUINT16_FORMAT, + ti = proto_tree_add_protocol_format(tree, proto_lbmr, tvb, O_LBMR_HDR_T_VER_TYPE, -1, "LBM Topic Resolution Protocol: Version %u, Type 0x%x (%s) TQRs %u, TIRs %" PRIu16, ver, type, val_to_str(type, lbmr_packet_type, "Unknown(0x%02x)"), tqrs, tirs); } } diff --git a/epan/dissectors/packet-lbmsrs.c b/epan/dissectors/packet-lbmsrs.c index 8da777d0d3..39b1b14526 100644 --- a/epan/dissectors/packet-lbmsrs.c +++ b/epan/dissectors/packet-lbmsrs.c @@ -2442,7 +2442,7 @@ static guint dissect_lbmsrs_data(tvbuff_t * tvb, packet_info * pinfo, proto_tree default: { expert_add_info_format(pinfo, tree, &ei_lbmsrs_analysis_invalid_msg_id, - "Invalid LBMSRS Message Id :%" G_GUINT16_FORMAT, message_id); + "Invalid LBMSRS Message Id :%" PRIu16, message_id); } diff --git a/epan/dissectors/packet-lbtrm.c b/epan/dissectors/packet-lbtrm.c index 55e715af0d..89ebd92ae9 100644 --- a/epan/dissectors/packet-lbtrm.c +++ b/epan/dissectors/packet-lbtrm.c @@ -328,7 +328,7 @@ static lbm_transport_frame_t * lbtrm_transport_frame_add(lbtrm_transport_t * tra static char * lbtrm_transport_source_string_format(wmem_allocator_t *pool, const address * source_address, guint16 source_port, guint32 session_id, const address * multicast_group, guint16 dest_port) { /* Returns a packet-scoped string. */ - return (wmem_strdup_printf(pool, "LBTRM:%s:%" G_GUINT16_FORMAT ":%08x:%s:%" G_GUINT16_FORMAT, address_to_str(pool, source_address), source_port, session_id, + return (wmem_strdup_printf(pool, "LBTRM:%s:%" PRIu16 ":%08x:%s:%" PRIu16, address_to_str(pool, source_address), source_port, session_id, address_to_str(pool, multicast_group), dest_port)); } @@ -1082,7 +1082,7 @@ static gboolean dissect_lbtrm_sqn_frame_list_callback(const void *key _U_, void { if (sqn_frame->retransmission) { - transport_item = proto_tree_add_uint_format_value(cb_data->tree, hf_lbtrm_analysis_sqn_frame, cb_data->tvb, 0, 0, sqn_frame->frame, "%" G_GUINT32_FORMAT " (RX)", sqn_frame->frame); + transport_item = proto_tree_add_uint_format_value(cb_data->tree, hf_lbtrm_analysis_sqn_frame, cb_data->tvb, 0, 0, sqn_frame->frame, "%" PRIu32 " (RX)", sqn_frame->frame); } else { @@ -1140,13 +1140,13 @@ static int dissect_lbtrm(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, session_id = tvb_get_ntohl(tvb, O_LBTRM_HDR_T_SESSION_ID); if (tag_name != NULL) { - lbtrm_item = proto_tree_add_protocol_format(tree, proto_lbtrm, tvb, offset, -1, "LBT-RM Protocol (Tag: %s): Version %u, Type %s: Source Unicast Port %" G_GUINT16_FORMAT ", Session ID 0x%08x", + lbtrm_item = proto_tree_add_protocol_format(tree, proto_lbtrm, tvb, offset, -1, "LBT-RM Protocol (Tag: %s): Version %u, Type %s: Source Unicast Port %" PRIu16 ", Session ID 0x%08x", tag_name, LBTRM_HDR_VER(ver_type), val_to_str(packet_type, lbtrm_packet_type, "Unknown (0x%02x)"), src_port, session_id); } else { - lbtrm_item = proto_tree_add_protocol_format(tree, proto_lbtrm, tvb, offset, -1, "LBT-RM Protocol: Version %u, Type %s: Source Unicast Port %" G_GUINT16_FORMAT ", Session ID 0x%08x", + lbtrm_item = proto_tree_add_protocol_format(tree, proto_lbtrm, tvb, offset, -1, "LBT-RM Protocol: Version %u, Type %s: Source Unicast Port %" PRIu16 ", Session ID 0x%08x", LBTRM_HDR_VER(ver_type), val_to_str(packet_type, lbtrm_packet_type, "Unknown (0x%02x)"), src_port, session_id); } @@ -1213,24 +1213,24 @@ static int dissect_lbtrm(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, flags_fec_type = tvb_get_guint8(tvb, L_LBTRM_HDR_T + O_LBTRM_DATA_HDR_T_FLAGS_FEC_TYPE); if ((flags_fec_type & LBTRM_DATA_RETRANSMISSION_FLAG) != 0) { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "DATA(RX) sqn 0x%x Port %" G_GUINT16_FORMAT " ID 0x%08x", sequence, src_port, session_id); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "DATA(RX) sqn 0x%x Port %" PRIu16 " ID 0x%08x", sequence, src_port, session_id); } else { - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "DATA sqn 0x%x Port %" G_GUINT16_FORMAT " ID 0x%08x", sequence, src_port, session_id); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "DATA sqn 0x%x Port %" PRIu16 " ID 0x%08x", sequence, src_port, session_id); } break; case LBTRM_PACKET_TYPE_SM: sequence = tvb_get_ntohl(tvb, L_LBTRM_HDR_T + O_LBTRM_SM_HDR_T_SM_SQN); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "SM sqn 0x%x Port %" G_GUINT16_FORMAT " ID 0x%08x", sequence, src_port, session_id); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "SM sqn 0x%x Port %" PRIu16 " ID 0x%08x", sequence, src_port, session_id); break; case LBTRM_PACKET_TYPE_NAK: num_naks = tvb_get_ntohs(tvb, L_LBTRM_HDR_T + O_LBTRM_NAK_HDR_T_NUM_NAKS); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NAK %u naks Port %" G_GUINT16_FORMAT " ID 0x%08x", num_naks, src_port, session_id); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NAK %u naks Port %" PRIu16 " ID 0x%08x", num_naks, src_port, session_id); break; case LBTRM_PACKET_TYPE_NCF: num_ncfs = tvb_get_ntohs(tvb, L_LBTRM_HDR_T + O_LBTRM_NCF_HDR_T_NUM_NCFS); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NCF %u ncfs Port %" G_GUINT16_FORMAT " ID 0x%08x", num_ncfs, src_port, session_id); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NCF %u ncfs Port %" PRIu16 " ID 0x%08x", num_ncfs, src_port, session_id); break; default: col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "Unknown (0x%02x)", packet_type); @@ -1352,13 +1352,13 @@ static int dissect_lbtrm(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, { transport_item = proto_tree_add_uint(transport_tree, hf_lbtrm_analysis_data_sqn_gap, tvb, 0, 0, frame->sqn_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_data_gap, "Data sequence gap (%" G_GUINT32_FORMAT ")", frame->sqn_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_data_gap, "Data sequence gap (%" PRIu32 ")", frame->sqn_gap); } if (frame->ooo_gap != 0) { transport_item = proto_tree_add_uint(transport_tree, hf_lbtrm_analysis_data_ooo_gap, tvb, 0, 0, frame->ooo_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_data_ooo, "Data sequence out of order gap (%" G_GUINT32_FORMAT ")", frame->ooo_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_data_ooo, "Data sequence out of order gap (%" PRIu32 ")", frame->ooo_gap); } if (frame->duplicate) { @@ -1400,13 +1400,13 @@ static int dissect_lbtrm(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, { transport_item = proto_tree_add_uint(transport_tree, hf_lbtrm_analysis_sm_sqn_gap, tvb, 0, 0, frame->sqn_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_sm_gap, "SM sequence gap (%" G_GUINT32_FORMAT ")", frame->sqn_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_sm_gap, "SM sequence gap (%" PRIu32 ")", frame->sqn_gap); } if (frame->ooo_gap != 0) { transport_item = proto_tree_add_uint(transport_tree, hf_lbtrm_analysis_sm_ooo_gap, tvb, 0, 0, frame->ooo_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_sm_ooo, "SM sequence out of order gap (%" G_GUINT32_FORMAT ")", frame->ooo_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtrm_analysis_sm_ooo, "SM sequence out of order gap (%" PRIu32 ")", frame->ooo_gap); } if (frame->duplicate) { diff --git a/epan/dissectors/packet-lbtru.c b/epan/dissectors/packet-lbtru.c index 42b1b0c701..2ac9c443b7 100644 --- a/epan/dissectors/packet-lbtru.c +++ b/epan/dissectors/packet-lbtru.c @@ -398,11 +398,11 @@ static char * lbtru_transport_source_string_format(const address * source_addres if (session_id == 0) { - bufptr = wmem_strdup_printf(wmem_packet_scope(), "LBT-RU:%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), source_address), source_port); + bufptr = wmem_strdup_printf(wmem_packet_scope(), "LBT-RU:%s:%" PRIu16, address_to_str(wmem_packet_scope(), source_address), source_port); } else { - bufptr = wmem_strdup_printf(wmem_packet_scope(), "LBT-RU:%s:%" G_GUINT16_FORMAT ":%08x", address_to_str(wmem_packet_scope(), source_address), source_port, session_id); + bufptr = wmem_strdup_printf(wmem_packet_scope(), "LBT-RU:%s:%" PRIu16 ":%08x", address_to_str(wmem_packet_scope(), source_address), source_port, session_id); } return (bufptr); } @@ -1085,7 +1085,7 @@ static gboolean dissect_lbtru_sqn_frame_list_callback(const void *key _U_, void { if (sqn_frame->retransmission) { - transport_item = proto_tree_add_uint_format_value(cb_data->tree, hf_lbtru_analysis_sqn_frame, cb_data->tvb, 0, 0, sqn_frame->frame, "%" G_GUINT32_FORMAT " (RX)", sqn_frame->frame); + transport_item = proto_tree_add_uint_format_value(cb_data->tree, hf_lbtru_analysis_sqn_frame, cb_data->tvb, 0, 0, sqn_frame->frame, "%" PRIu32 " (RX)", sqn_frame->frame); } else { @@ -1224,12 +1224,12 @@ static int dissect_lbtru(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, break; case LBTRU_PACKET_TYPE_NAK: num_naks = tvb_get_ntohs(tvb, L_LBTRU_HDR_T + O_LBTRU_NAK_HDR_T_NUM_NAKS); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NAK %" G_GUINT16_FORMAT " naks", num_naks); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NAK %" PRIu16 " naks", num_naks); from_source = FALSE; break; case LBTRU_PACKET_TYPE_NCF: num_ncfs = tvb_get_ntohs(tvb, L_LBTRU_HDR_T + O_LBTRU_NCF_HDR_T_NUM_NCFS); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NCF %" G_GUINT16_FORMAT " ncfs", num_ncfs); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "NCF %" PRIu16 " ncfs", num_ncfs); from_source = TRUE; break; case LBTRU_PACKET_TYPE_ACK: @@ -1509,14 +1509,14 @@ static int dissect_lbtru(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, { transport_item = proto_tree_add_uint(transport_tree, hf_lbtru_analysis_data_sqn_gap, tvb, 0, 0, frame->sqn_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_data_gap, "Data sequence gap (%" G_GUINT32_FORMAT ")", frame->sqn_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_data_gap, "Data sequence gap (%" PRIu32 ")", frame->sqn_gap); } if (frame->ooo_gap != 0) { transport_item = proto_tree_add_uint(transport_tree, hf_lbtru_analysis_data_ooo_gap, tvb, 0, 0, frame->ooo_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_data_ooo, "Data sequence out of order gap (%" G_GUINT32_FORMAT ")", frame->ooo_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_data_ooo, "Data sequence out of order gap (%" PRIu32 ")", frame->ooo_gap); } if (frame->duplicate) { @@ -1558,14 +1558,14 @@ static int dissect_lbtru(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, { transport_item = proto_tree_add_uint(transport_tree, hf_lbtru_analysis_sm_sqn_gap, tvb, 0, 0, frame->sqn_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_sm_gap, "SM sequence gap (%" G_GUINT32_FORMAT ")", frame->sqn_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_sm_gap, "SM sequence gap (%" PRIu32 ")", frame->sqn_gap); } if (frame->ooo_gap != 0) { transport_item = proto_tree_add_uint(transport_tree, hf_lbtru_analysis_sm_ooo_gap, tvb, 0, 0, frame->ooo_gap); proto_item_set_generated(transport_item); - expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_sm_ooo, "SM sequence out of order gap (%" G_GUINT32_FORMAT ")", frame->ooo_gap); + expert_add_info_format(pinfo, transport_item, &ei_lbtru_analysis_sm_ooo, "SM sequence out of order gap (%" PRIu32 ")", frame->ooo_gap); } if (frame->duplicate) { diff --git a/epan/dissectors/packet-lbttcp.c b/epan/dissectors/packet-lbttcp.c index 92603db943..82c69562f1 100644 --- a/epan/dissectors/packet-lbttcp.c +++ b/epan/dissectors/packet-lbttcp.c @@ -173,11 +173,11 @@ char * lbttcp_transport_source_string(const address * source_address, guint16 so if (session_id == 0) { - bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), source_address), source_port); + bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" PRIu16, address_to_str(wmem_packet_scope(), source_address), source_port); } else { - bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" G_GUINT16_FORMAT ":%08x", address_to_str(wmem_packet_scope(), source_address), source_port, session_id); + bufptr = wmem_strdup_printf(wmem_file_scope(), "TCP:%s:%" PRIu16 ":%08x", address_to_str(wmem_packet_scope(), source_address), source_port, session_id); } return (bufptr); } diff --git a/epan/dissectors/packet-lisp-tcp.c b/epan/dissectors/packet-lisp-tcp.c index cf1aedc9ad..c8e253748f 100644 --- a/epan/dissectors/packet-lisp-tcp.c +++ b/epan/dissectors/packet-lisp-tcp.c @@ -401,7 +401,7 @@ dissect_lisp_tcp_membership_message(tvbuff_t *tvb, packet_info *pinfo, proto_tre proto_tree_add_item(message_tree, hf_lisp_tcp_message_site_id, tvb, offset, LISP_SITEID_LEN, ENC_NA); offset += 8; data_len -= 8; - proto_item_append_text(tim, ", Site-ID: %"G_GINT64_MODIFIER"u", siteid); + proto_item_append_text(tim, ", Site-ID: %"PRIu64, siteid); /* RLOC AFI (2 bytes) */ afi = tvb_get_ntohs(tvb, offset); diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c index c45c6651c0..13d418de55 100644 --- a/epan/dissectors/packet-llc.c +++ b/epan/dissectors/packet-llc.c @@ -210,7 +210,7 @@ static wmem_map_t *oui_info_table = NULL; static void llc_sap_value( gchar *result, guint32 sap ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%s", val_to_str_const(sap<<1, sap_vals, "Unknown")); + snprintf( result, ITEM_LABEL_LENGTH, "%s", val_to_str_const(sap<<1, sap_vals, "Unknown")); } /* diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index cbcd234a13..3f63189f07 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -1311,12 +1311,12 @@ static const unit_name_string units_m = { " m", NULL }; static void mdi_power_base(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u. Watt", value/10, value%10); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%u. Watt", value/10, value%10); } static void media_power_base(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u mW", value * 100); + snprintf(buf, ITEM_LABEL_LENGTH, "%u mW", value * 100); } /* Calculate Latitude and Longitude string */ @@ -1374,7 +1374,7 @@ get_latitude_or_longitude(gchar *buf, int option, guint64 unmasked_value) direction = "East"; } - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%04" G_GINT64_MODIFIER "u degrees %s (0x%010" G_GINT64_MODIFIER "X)", + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%04" PRIu64 " degrees %s (0x%010" PRIX64 ")", integerPortion, tempValue, direction, value); } diff --git a/epan/dissectors/packet-loratap.c b/epan/dissectors/packet-loratap.c index daa9c866de..de40bce185 100644 --- a/epan/dissectors/packet-loratap.c +++ b/epan/dissectors/packet-loratap.c @@ -55,7 +55,7 @@ static const value_string syncwords[] = { static void rssi_base_custom(gchar *buffer, guint32 value) { - g_snprintf(buffer, ITEM_LABEL_LENGTH, "%.0f dBm", -139 + (float)value); + snprintf(buffer, ITEM_LABEL_LENGTH, "%.0f dBm", -139 + (float)value); } static void @@ -65,13 +65,13 @@ snr_base_custom(gchar *buffer, guint32 value) { } else { value = ( value & 0xFF ) >> 2; } - g_snprintf(buffer, ITEM_LABEL_LENGTH, "%d dB", value); + snprintf(buffer, ITEM_LABEL_LENGTH, "%d dB", value); } static void loratap_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "LoRaTap syncword 0x%02x as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_loratap, 0))); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "LoRaTap syncword 0x%02x as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_loratap, 0))); } static gpointer diff --git a/epan/dissectors/packet-ltp.c b/epan/dissectors/packet-ltp.c index 2cb32a9b9b..585888a1a7 100644 --- a/epan/dissectors/packet-ltp.c +++ b/epan/dissectors/packet-ltp.c @@ -266,7 +266,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int /* Client ID - 0 = Bundle Protocol, 1 = CCSDS LTP Service Data Aggregation */ sdnv_status = evaluate_sdnv64(tvb, frame_offset, &sdnv_length, &client_id); ti = proto_tree_add_uint64_format_value(ltp_data_tree, hf_ltp_data_clid, tvb, frame_offset, sdnv_length, client_id, - "%" G_GINT64_MODIFIER "u (%s)", client_id, + "%" PRIu64 " (%s)", client_id, val_to_str_const((const guint32) client_id, client_service_id_info, "Invalid")); if (!sdnv_status) { expert_add_info(pinfo, ti, &ei_ltp_sdnv_length); @@ -378,7 +378,7 @@ dissect_data_segment(proto_tree *ltp_tree, tvbuff_t *tvb,packet_info *pinfo,int if (client_id == 2) { sdnv_status = evaluate_sdnv64(tvb, frame_offset+parse_offset, &sdnv_length, &sda_client_id); ti = proto_tree_add_uint64_format_value(ltp_data_data_tree, hf_ltp_data_sda_clid, tvb, frame_offset+parse_offset, sdnv_length, sda_client_id, - "%" G_GINT64_MODIFIER "u (%s)", sda_client_id, val_to_str_const((const guint32) sda_client_id, client_service_id_info, "Invalid")); + "%" PRIu64 " (%s)", sda_client_id, val_to_str_const((const guint32) sda_client_id, client_service_id_info, "Invalid")); if (!sdnv_status) { expert_add_info(pinfo, ti, &ei_ltp_sdnv_length); @@ -499,12 +499,12 @@ dissect_report_segment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ltp_tree, for(i = 0; iopcode, trans->sub_opcode, trans->match_bits, info->match_bits); } } @@ -1714,7 +1714,7 @@ lustre_fmt_ver( gchar *result, guint32 version ) minor = version & 0xff; version >>= 8; major = version & 0xff; - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d", major, minor, patch, fix); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d", major, minor, patch, fix); } static int @@ -1751,7 +1751,7 @@ dissect_struct_lu_fid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, int hf tree = proto_item_add_subtree(item, ett_lustre_lu_fid); proto_tree_add_item_ret_uint64(tree, hf_lustre_lu_fid_f_seq, tvb, offset, 8, ENC_LITTLE_ENDIAN, &seq); - proto_item_append_text(item, ": [%#" G_GINT64_MODIFIER "x:", seq); + proto_item_append_text(item, ": [%#" PRIx64 ":", seq); offset += 8; proto_tree_add_item_ret_uint(tree, hf_lustre_lu_fid_f_oid, tvb, offset, 4, ENC_LITTLE_ENDIAN, &val); @@ -4176,7 +4176,7 @@ dissect_struct_ptlrpc_body(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent if (*pb_type == PTL_RPC_MSG_REQUEST) trans->opcode = opcode; else if (trans->opcode != opcode) { - expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "Mismatched: PTLRPC:%s != Conversation:%s (match_bits:%" G_GINT64_MODIFIER "x)", + expert_add_info_format(pinfo, tree, &ei_lustre_badopc, "Mismatched: PTLRPC:%s != Conversation:%s (match_bits:%" PRIx64 ")", val_to_str(opcode, lustre_op_codes, "Unknown(%d)"), val_to_str(trans->opcode, lustre_op_codes, "Unknown(%d)"), trans->match_bits); trans->opcode = opcode; diff --git a/epan/dissectors/packet-lwm2mtlv.c b/epan/dissectors/packet-lwm2mtlv.c index a4e7fd6531..133a809ac8 100644 --- a/epan/dissectors/packet-lwm2mtlv.c +++ b/epan/dissectors/packet-lwm2mtlv.c @@ -724,13 +724,13 @@ addValueInterpretations(packet_info *pinfo, tvbuff_t *tvb, proto_tree *tlv_tree, } case DATA_TYPE_INTEGER: proto_tree_add_item(tlv_tree, *resource->hf_id, tvb, valueOffset, element->length_of_value, ENC_BIG_ENDIAN); - proto_item_append_text(tlv_tree, ": %" G_GINT64_FORMAT, decodeVariableInt(tvb, valueOffset, element->length_of_value)); + proto_item_append_text(tlv_tree, ": %" PRId64, decodeVariableInt(tvb, valueOffset, element->length_of_value)); break; case DATA_TYPE_UNSIGNED_INTEGER: { guint64 value; proto_tree_add_item_ret_uint64(tlv_tree, *resource->hf_id, tvb, valueOffset, element->length_of_value, ENC_BIG_ENDIAN, &value); - proto_item_append_text(tlv_tree, ": %" G_GUINT64_FORMAT, value); + proto_item_append_text(tlv_tree, ": %" PRIu64, value); break; } case DATA_TYPE_FLOAT: diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index 5d69091a33..7e48c8a3a1 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -2766,7 +2766,7 @@ static void write_pdu_label_and_info(proto_item *ti1, proto_item *ti2, } va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); /* Add to indicated places */ @@ -2781,7 +2781,7 @@ static void write_pdu_label_and_info(proto_item *ti1, proto_item *ti2, } } -/* Version of function above, where no g_vsnprintf() call needed */ +/* Version of function above, where no vsnprintf() call needed */ static void write_pdu_label_and_info_literal(proto_item *ti1, proto_item *ti2, packet_info *pinfo, const char *info_buffer) { diff --git a/epan/dissectors/packet-mac-nr.c b/epan/dissectors/packet-mac-nr.c index 0a9b36bc01..f49ea19fe3 100644 --- a/epan/dissectors/packet-mac-nr.c +++ b/epan/dissectors/packet-mac-nr.c @@ -1109,7 +1109,7 @@ static void write_pdu_label_and_info(proto_item *ti1, proto_item *ti2, } va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); /* Add to indicated places */ @@ -1124,7 +1124,7 @@ static void write_pdu_label_and_info(proto_item *ti1, proto_item *ti2, } } -/* Version of function above, where no g_vsnprintf() call needed */ +/* Version of function above, where no vsnprintf() call needed */ static void write_pdu_label_and_info_literal(proto_item *ti1, proto_item *ti2, packet_info *pinfo, const char *info_buffer) { @@ -1547,13 +1547,13 @@ mac_nr_phr_fmt(gchar *s, guint32 v) gint32 val = (gint32)v; if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "PH < -32 dB (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "PH < -32 dB (0)"); } else if (val == 63) { - g_snprintf(s, ITEM_LABEL_LENGTH, "PH >= 38 dB (63)"); + snprintf(s, ITEM_LABEL_LENGTH, "PH >= 38 dB (63)"); } else if (val <= 54) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dB <= PH < %d dB (%d)", val - 33, val - 32, val); + snprintf(s, ITEM_LABEL_LENGTH, "%d dB <= PH < %d dB (%d)", val - 33, val - 32, val); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dB <= PH < %d dB (%d)", 22 + 2 * (val - 55), 24 + 2 * (val - 55), val); + snprintf(s, ITEM_LABEL_LENGTH, "%d dB <= PH < %d dB (%d)", 22 + 2 * (val - 55), 24 + 2 * (val - 55), val); } } @@ -1564,11 +1564,11 @@ mac_nr_pcmax_f_c_fmt(gchar *s, guint32 v) gint32 val = (gint32)v; if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Pcmax,f,c < -29 dBm (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "Pcmax,f,c < -29 dBm (0)"); } else if (val == 63) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Pcmax,f,c >= 33 dBm (63)"); + snprintf(s, ITEM_LABEL_LENGTH, "Pcmax,f,c >= 33 dBm (63)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm <= Pcmax,f,c < %d dBm (%d)", val - 30, val - 29, val); + snprintf(s, ITEM_LABEL_LENGTH, "%d dBm <= Pcmax,f,c < %d dBm (%d)", val - 30, val - 29, val); } } diff --git a/epan/dissectors/packet-manolito.c b/epan/dissectors/packet-manolito.c index 20c730c64b..7ab2aa0ab9 100644 --- a/epan/dissectors/packet-manolito.c +++ b/epan/dissectors/packet-manolito.c @@ -190,7 +190,7 @@ dissect_manolito(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* diss if (len_ok) { proto_tree_add_uint64_format(manolito_tree, hf_manolito_integer, tvb, start, - 4+length, n, "%s (%s): %" G_GINT64_MODIFIER "u", + 4+length, n, "%s (%s): %" PRIu64, field_name_str, val_to_str_ext(field_name, &field_longname_ext, "unknown"), n); diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c index 0fb312a232..00b248cca6 100644 --- a/epan/dissectors/packet-mbim.c +++ b/epan/dissectors/packet-mbim.c @@ -1940,15 +1940,15 @@ static void mbim_rssi_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-113 or less dBm (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "-113 or less dBm (0)"); } else if (val < 31) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -113 + 2*val, val); + snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -113 + 2*val, val); } else if (val == 31) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-51 or greater dBm (31)"); + snprintf(s, ITEM_LABEL_LENGTH, "-51 or greater dBm (31)"); } else if (val == 99) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (99)"); + snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (99)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); } } @@ -2592,7 +2592,7 @@ static const value_string mbim_sar_status_vals[] = { static void mbim_degrees_fmt(gchar *s, guint32 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f Degrees Celsius (%u)", (float)v/10.0, v); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f Degrees Celsius (%u)", (float)v/10.0, v); } static const value_string mbim_adpclk_activate_state_vals[] = { @@ -2630,15 +2630,15 @@ static void mbim_rscp_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-120 or less dBm (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "-120 or less dBm (0)"); } else if (val < 96) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -120 + val, val); + snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -120 + val, val); } else if (val == 96) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-24 or greater dBm (96)"); + snprintf(s, ITEM_LABEL_LENGTH, "-24 or greater dBm (96)"); } else if (val == 255) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); + snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); } } @@ -2646,15 +2646,15 @@ static void mbim_ecno_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-24 or less dBm (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "-24 or less dBm (0)"); } else if (val < 49) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f dBm (%u)", -24 + ((float)val/2), val); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f dBm (%u)", -24 + ((float)val/2), val); } else if (val == 49) { - g_snprintf(s, ITEM_LABEL_LENGTH, "0.5 or greater dBm (49)"); + snprintf(s, ITEM_LABEL_LENGTH, "0.5 or greater dBm (49)"); } else if (val == 255) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); + snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); } } @@ -2662,15 +2662,15 @@ static void mbim_rsrq_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-19.5 or less dBm (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "-19.5 or less dBm (0)"); } else if (val < 34) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f dBm (%u)", -19.5 + ((float)val/2), val); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f dBm (%u)", -19.5 + ((float)val/2), val); } else if (val == 34) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-2.5 or greater dBm (34)"); + snprintf(s, ITEM_LABEL_LENGTH, "-2.5 or greater dBm (34)"); } else if (val == 255) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); + snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); } } @@ -2678,15 +2678,15 @@ static void mbim_rsrp_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-140 or less dBm (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "-140 or less dBm (0)"); } else if (val < 97) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -140 + val, val); + snprintf(s, ITEM_LABEL_LENGTH, "%d dBm (%u)", -140 + val, val); } else if (val == 97) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-43 or greater dBm (97)"); + snprintf(s, ITEM_LABEL_LENGTH, "-43 or greater dBm (97)"); } else if (val == 255) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); + snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); } } @@ -2694,15 +2694,15 @@ static void mbim_rssnr_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-5 or less dB (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "-5 or less dB (0)"); } else if (val < 35) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dB (%u)", -5 + val, val); + snprintf(s, ITEM_LABEL_LENGTH, "%d dB (%u)", -5 + val, val); } else if (val == 35) { - g_snprintf(s, ITEM_LABEL_LENGTH, "30 or greater dB (35)"); + snprintf(s, ITEM_LABEL_LENGTH, "30 or greater dB (35)"); } else if (val == 255) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); + snprintf(s, ITEM_LABEL_LENGTH, "Unknown or undetectable (255)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value (%u)", val); } } @@ -2710,13 +2710,13 @@ static void mbim_rsrp_signal_state_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "SS-RSRP < -156dBm (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "SS-RSRP < -156dBm (0)"); } else if (val < 126) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= SS-RSRP < %ddBm (%u)", val - 157, val - 156, val); + snprintf(s, ITEM_LABEL_LENGTH, "%ddBm <= SS-RSRP < %ddBm (%u)", val - 157, val - 156, val); } else if (val == 126) { - g_snprintf(s, ITEM_LABEL_LENGTH, "-31dBm <= SS-RSRP (126)"); + snprintf(s, ITEM_LABEL_LENGTH, "-31dBm <= SS-RSRP (126)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "invalid (127)"); + snprintf(s, ITEM_LABEL_LENGTH, "invalid (127)"); } } @@ -2724,20 +2724,20 @@ static void mbim_snr_signal_state_fmt(gchar *s, guint32 val) { if (val == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "SS-SINR < -23dB (0)"); + snprintf(s, ITEM_LABEL_LENGTH, "SS-SINR < -23dB (0)"); } else if (val < 127) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB <= SS-SINR < %.1fdB (%u)", (((float)val - 1) / 2) - 23, ((float)val / 2) - 23, val); + snprintf(s, ITEM_LABEL_LENGTH, "%.1fdB <= SS-SINR < %.1fdB (%u)", (((float)val - 1) / 2) - 23, ((float)val / 2) - 23, val); } else if (val == 127){ - g_snprintf(s, ITEM_LABEL_LENGTH, "40dB <= SS-SINR (127)"); + snprintf(s, ITEM_LABEL_LENGTH, "40dB <= SS-SINR (127)"); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "invalid (128)"); + snprintf(s, ITEM_LABEL_LENGTH, "invalid (128)"); } } static void mbim_version_fmt(gchar* s, guint32 val) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%u.%u", val / 256, val % 256); + snprintf(s, ITEM_LABEL_LENGTH, "%u.%u", val / 256, val % 256); } static const value_string mbim_atds_operator_plmn_mode_vals[] = { @@ -2769,7 +2769,7 @@ mbim_projection_table_coeff_fmt(gchar *s, guint32 val) { gint32 coeff = (gint32)val; - g_snprintf(s, ITEM_LABEL_LENGTH, "%.3f (%d)", ((float)coeff)/1000, coeff); + snprintf(s, ITEM_LABEL_LENGTH, "%.3f (%d)", ((float)coeff)/1000, coeff); } #define MBIM_NDP_CTRL_MULTIFLOW_STATUS 0 diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c index c13fabee63..a8142ba760 100644 --- a/epan/dissectors/packet-megaco.c +++ b/epan/dissectors/packet-megaco.c @@ -3589,7 +3589,7 @@ megaco_fmt_content( gchar *result, guint32 context ) (void) g_strlcpy(result, val_to_str_const(context, megaco_context_vals, "Unknown"), ITEM_LABEL_LENGTH); break; default: - g_snprintf( result, ITEM_LABEL_LENGTH, "%d", context); + snprintf( result, ITEM_LABEL_LENGTH, "%d", context); } } diff --git a/epan/dissectors/packet-metamako.c b/epan/dissectors/packet-metamako.c index f6c9bfc334..1bd5b8192f 100644 --- a/epan/dissectors/packet-metamako.c +++ b/epan/dissectors/packet-metamako.c @@ -60,7 +60,7 @@ sub_nanos_base_custom(gchar *result, guint32 value) { double temp_double; temp_double = ((double)value) / (1U << 24); - g_snprintf(result, ITEM_LABEL_LENGTH, "%1.9fns", temp_double); + snprintf(result, ITEM_LABEL_LENGTH, "%1.9fns", temp_double); } static int diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c index 1c3c4f8592..8581510581 100644 --- a/epan/dissectors/packet-mgcp.c +++ b/epan/dissectors/packet-mgcp.c @@ -1173,7 +1173,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (verb_description != NULL) { /* Can show verb along with code if known */ - g_snprintf(code_with_verb, 64, "%s (%s)", code, verb_description); + snprintf(code_with_verb, 64, "%s (%s)", code, verb_description); } proto_tree_add_string_format(tree, hf_mgcp_req_verb, tvb, diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c index e458f8cd2f..937b614983 100644 --- a/epan/dissectors/packet-mip6.c +++ b/epan/dissectors/packet-mip6.c @@ -3501,7 +3501,7 @@ degrees_convert_fixed_to_float(guint value) static void degrees_base_custom(gchar *str, guint degrees) { - g_snprintf(str, ITEM_LABEL_LENGTH, "%f", degrees_convert_fixed_to_float(degrees) ); + snprintf(str, ITEM_LABEL_LENGTH, "%f", degrees_convert_fixed_to_float(degrees) ); } static int diff --git a/epan/dissectors/packet-mka.c b/epan/dissectors/packet-mka.c index 64c307bf56..b74f9e98e1 100644 --- a/epan/dissectors/packet-mka.c +++ b/epan/dissectors/packet-mka.c @@ -588,7 +588,7 @@ dissect_announcement(proto_tree *mka_tree, packet_info *pinfo, tvbuff_t *tvb, in guint16 cipher_suite_cap = tvb_get_guint16(tvb, offset + offset2 + tlv_item_offset, ENC_BIG_ENDIAN) & 0x0003; ti = proto_tree_add_none_format(tlv_tree, hf_mka_tlv_entry, tvb, offset + offset2, tlv_length + 2, "Cipher Suite: %s, %s", - val64_to_str(cipher_suite_id, macsec_cipher_suite_vals, "Unknown Cipher Suite (0x%" G_GINT64_MODIFIER "x)"), + val64_to_str(cipher_suite_id, macsec_cipher_suite_vals, "Unknown Cipher Suite (0x%" PRIx64 ")"), val_to_str(cipher_suite_cap, macsec_capability_type_vals, "Unknown Capability (%d)")); cipher_suite_entry = proto_item_add_subtree(ti, ett_mka_cipher_suite_entry); diff --git a/epan/dissectors/packet-moldudp.c b/epan/dissectors/packet-moldudp.c index b3642e3107..09d02f6c2c 100644 --- a/epan/dissectors/packet-moldudp.c +++ b/epan/dissectors/packet-moldudp.c @@ -48,7 +48,7 @@ static dissector_table_t moldudp_payload_table; static void moldudp_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); } /* Code to dissect a message block */ diff --git a/epan/dissectors/packet-moldudp64.c b/epan/dissectors/packet-moldudp64.c index 9f505966e1..c503e18122 100644 --- a/epan/dissectors/packet-moldudp64.c +++ b/epan/dissectors/packet-moldudp64.c @@ -51,7 +51,7 @@ static dissector_table_t moldudp64_payload_table; static void moldudp64_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); } /* Code to dissect a message block */ diff --git a/epan/dissectors/packet-mpeg-sect.c b/epan/dissectors/packet-mpeg-sect.c index 41196cd0c8..ba8681dcf0 100644 --- a/epan/dissectors/packet-mpeg-sect.c +++ b/epan/dissectors/packet-mpeg-sect.c @@ -143,7 +143,7 @@ static const value_string mpeg_sect_table_id_vals[] = { static void mpeg_sect_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Table ID %u as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Table ID %u as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_mpeg_sect, MPEG_SECT_TID_KEY))); } diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index 7e38531fb6..bb6d5e7dd5 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -204,7 +204,7 @@ static dissector_table_t mpls_subdissector_table; static void mpls_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Data after label %u as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Data after label %u as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_mpls, 0))); } @@ -215,7 +215,7 @@ static gpointer mpls_value(packet_info *pinfo) static void pw_ach_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Channel type 0x%x as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Channel type 0x%x as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_pw_ach, 0))); } diff --git a/epan/dissectors/packet-mq-pcf.c b/epan/dissectors/packet-mq-pcf.c index 346e31fc0e..345bb0fa4b 100644 --- a/epan/dissectors/packet-mq-pcf.c +++ b/epan/dissectors/packet-mq-pcf.c @@ -242,12 +242,12 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre uLenF = 12; if (bParse) - g_snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-4.4s} 0x%08x (%4d) %-30.30s", + snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-4.4s} 0x%08x (%4d) %-30.30s", "MQPrm", uDig, u + 1, uTyp, val_to_str_ext_const(uTyp, GET_VALS_EXTP(PrmTyp2), " Unkn") + 6, uPrm, uPrm, val_to_str_ext_const(uPrm, GET_VALS_EXTP(PrmId), "Unknown")); else - g_snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-4.4s} 0x%08x (%4d)", + snprintf(strPrm, (gulong)sizeof(strPrm) - 1, " %-s[%*u] {%2d-%-4.4s} 0x%08x (%4d)", "XtraD", uDig, u + 1, uTyp, val_to_str_ext_const(uTyp, GET_VALS_EXTP(PrmTyp2), " Unkn") + 6, uPrm, uPrm); @@ -528,7 +528,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre { uVal64 = tvb_get_guint64(tvb, offset + uLenF + 4, bLittleEndian); tree = proto_tree_add_subtree_format(mq_tree, tvb, offset, uLen, ett_mqpcf_prm, NULL, - "%s: 0x%" G_GINT64_MODIFIER "x (%" G_GINT64_MODIFIER "d)", strPrm, uVal64, uVal64); + "%s: 0x%" PRIx64 " (%" PRId64 ")", strPrm, uVal64, uVal64); proto_tree_add_item(tree, hf_mq_pcf_prmtyp, tvb, offset, 4, bLittleEndian); proto_tree_add_item(tree, hf_mq_pcf_prmlen, tvb, offset + 4, 4, bLittleEndian); @@ -560,7 +560,7 @@ guint32 dissect_mqpcf_parm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *mq_tre { uVal64 = tvb_get_guint64(tvb, offset, bLittleEndian); proto_tree_add_int64_format(tree, hf_mq_pcf_int64list, tvb, offset, 8, uVal64, - "%s[%*d]: 0x%" G_GINT64_MODIFIER "x (%" G_GINT64_MODIFIER "d)", + "%s[%*d]: 0x%" PRIx64 " (%" PRId64 ")", hfinfo->name, uDigit, u2 + 1, uVal64, uVal64); offset += 8; } @@ -612,7 +612,7 @@ static void dissect_mqpcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, m if (uCC || uRC) { - g_snprintf(sTmp, (gulong)sizeof(sTmp) - 1, " %-s [%d-%s] {%d-%s} PrmCnt(%d) CC(%d-%s) RC(%d-%s)", + snprintf(sTmp, (gulong)sizeof(sTmp) - 1, " %-s [%d-%s] {%d-%s} PrmCnt(%d) CC(%d-%s) RC(%d-%s)", MQ_TEXT_CFH, uTyp, val_to_str_const(uTyp, GET_VALSV(mqcft), "Unknown"), uCmd, val_to_str_ext_const(uCmd, GET_VALS_EXTP(MQCMD), "Unknown"), @@ -622,7 +622,7 @@ static void dissect_mqpcf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, m } else { - g_snprintf(sTmp, (gulong)sizeof(sTmp) - 1, " %-s [%d-%s] {%d-%s} PrmCnt(%d)", + snprintf(sTmp, (gulong)sizeof(sTmp) - 1, " %-s [%d-%s] {%d-%s} PrmCnt(%d)", MQ_TEXT_CFH, uTyp, val_to_str_const(uTyp, GET_VALSV(mqcft), "Unknown"), uCmd, val_to_str_ext_const(uCmd, GET_VALS_EXTP(MQCMD), "Unknown"), diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index b4f85cebec..461b0b0319 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -1309,7 +1309,7 @@ static gint dissect_mq_encoding(proto_tree* tree, int hfindex, tvbuff_t* tvb, co pEnc = sEnc; #define CHECK_ENC(M, T) ((uEnc & M) == T) -#define DOPRT(A) pEnc += g_snprintf(pEnc, (gulong)(sizeof(sEnc)-1-(pEnc-sEnc)), A); +#define DOPRT(A) pEnc += snprintf(pEnc, (gulong)(sizeof(sEnc)-1-(pEnc-sEnc)), A); if (CHECK_ENC(MQ_MQENC_FLOAT_MASK, MQ_MQENC_FLOAT_UNDEFINED)) { DOPRT("FLT_UNDEFINED"); diff --git a/epan/dissectors/packet-msgpack.c b/epan/dissectors/packet-msgpack.c index 9e15f59a7c..032452c131 100644 --- a/epan/dissectors/packet-msgpack.c +++ b/epan/dissectors/packet-msgpack.c @@ -121,7 +121,7 @@ static void dissect_msgpack_integer(tvbuff_t* tvb, packet_info *pinfo, proto_tre uint64 = tvb_get_ntoh64(tvb, *offset + 1); proto_tree_add_uint64(tree, hf_msgpack_uint_64, tvb, *offset, 9, uint64); if (value) - *value = wmem_strdup_printf(pinfo->pool, "%" G_GINT64_MODIFIER "u", uint64); + *value = wmem_strdup_printf(pinfo->pool, "%" PRIu64, uint64); *offset += 9; break; case 0xd0: @@ -149,7 +149,7 @@ static void dissect_msgpack_integer(tvbuff_t* tvb, packet_info *pinfo, proto_tre int64 = tvb_get_ntoh64(tvb, *offset + 1); proto_tree_add_int64(tree, hf_msgpack_int_64, tvb, *offset, 9, int64); if (value) - *value = wmem_strdup_printf(pinfo->pool, "%" G_GINT64_MODIFIER "d", int64); + *value = wmem_strdup_printf(pinfo->pool, "%" PRId64, int64); *offset += 9; break; default: diff --git a/epan/dissectors/packet-msnlb.c b/epan/dissectors/packet-msnlb.c index 7f394f7a6b..faf83cbed4 100644 --- a/epan/dissectors/packet-msnlb.c +++ b/epan/dissectors/packet-msnlb.c @@ -108,7 +108,7 @@ static true_false_string tfs_reverse_normal = { "Reverse", "Normal" }; static void version_base_custom(gchar *result, guint32 version) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%d.%d", (version >> 8) & 0xFF, (version & 0xFF)); + snprintf(result, ITEM_LABEL_LENGTH, "%d.%d", (version >> 8) & 0xFF, (version & 0xFF)); } static int diff --git a/epan/dissectors/packet-mswsp.c b/epan/dissectors/packet-mswsp.c index 1b09dc5601..3b6e2e99fb 100644 --- a/epan/dissectors/packet-mswsp.c +++ b/epan/dissectors/packet-mswsp.c @@ -2958,21 +2958,21 @@ static void get_name_from_fullpropspec(struct CFullPropSpec *v, char *out, int b id_str = pset ? try_val_to_str(v->u.propid, pset->id_map) : NULL; if (id_str) { - g_snprintf(dest, bufsize, "%s", id_str); + snprintf(dest, bufsize, "%s", id_str); } else { guid_str = guids_get_guid_name(&v->guid, wmem_packet_scope()); if (guid_str) { - g_snprintf(dest, bufsize, "\"%s\"", guid_str); + snprintf(dest, bufsize, "\"%s\"", guid_str); } else { guid_str = guid_to_str(wmem_packet_scope(), &v->guid); - g_snprintf(dest, bufsize, "{%s}", guid_str); + snprintf(dest, bufsize, "{%s}", guid_str); } if (v->kind == PRSPEC_LPWSTR) { - g_snprintf(dest, bufsize, "%s \"%s\"", guid_str, v->u.name); + snprintf(dest, bufsize, "%s \"%s\"", guid_str, v->u.name); } else if (v->kind == PRSPEC_PROPID) { - g_snprintf(dest, bufsize, "%s 0x%08x", guid_str, v->u.propid); + snprintf(dest, bufsize, "%s 0x%08x", guid_str, v->u.propid); } else { - g_snprintf(dest, bufsize, "%s ", dest); + snprintf(dest, bufsize, "%s ", dest); } } } @@ -4055,7 +4055,7 @@ static void vvalue_strbuf_append_i4(wmem_strbuf_t *strbuf, void *ptr) static void vvalue_strbuf_append_i8(wmem_strbuf_t *strbuf, void *ptr) { gint64 i8 = *(gint64*)ptr; - wmem_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "d", i8); + wmem_strbuf_append_printf(strbuf, "%" PRId64, i8); } static void vvalue_strbuf_append_ui1(wmem_strbuf_t *strbuf, void *ptr) @@ -4079,7 +4079,7 @@ static void vvalue_strbuf_append_ui4(wmem_strbuf_t *strbuf, void *ptr) static void vvalue_strbuf_append_ui8(wmem_strbuf_t *strbuf, void *ptr) { guint64 ui8 = *(guint64*)ptr; - wmem_strbuf_append_printf(strbuf, "%" G_GINT64_MODIFIER "u", ui8); + wmem_strbuf_append_printf(strbuf, "%" PRIu64, ui8); } static void vvalue_strbuf_append_r4(wmem_strbuf_t *strbuf, void *ptr) @@ -5218,7 +5218,7 @@ static int parse_VariantColVector(tvbuff_t *tvb, int offset, proto_tree *tree, g size = 8; address_of_address = buf_offset + (i * size); item_address = tvb_get_letoh64(tvb, address_of_address); - proto_tree_add_uint64_format(sub_tree, hf_mswsp_rowvariant_item_address64, tvb, address_of_address, size, item_address, "address[%d] 0x%" G_GINT64_MODIFIER "x", i, item_address); + proto_tree_add_uint64_format(sub_tree, hf_mswsp_rowvariant_item_address64, tvb, address_of_address, size, item_address, "address[%d] 0x%" PRIx64, i, item_address); } else { size = 4; item_address = tvb_get_letohl(tvb, buf_offset + (i * size)); diff --git a/epan/dissectors/packet-mtp2.c b/epan/dissectors/packet-mtp2.c index 96f6c7e8bf..f17a84d04c 100644 --- a/epan/dissectors/packet-mtp2.c +++ b/epan/dissectors/packet-mtp2.c @@ -595,7 +595,7 @@ debug(char *format, ...) buffer[0] = '\0'; va_start(args,format); - g_vsnprintf(buffer,max_buffer_length,format,args); + vsnprintf(buffer,max_buffer_length,format,args); g_printf("%s",buffer); va_end (args); } diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c index f74c14ee7c..8588aa9537 100644 --- a/epan/dissectors/packet-mtp3.c +++ b/epan/dissectors/packet-mtp3.c @@ -233,15 +233,15 @@ mtp3_pc_to_str_buf(const guint32 pc, gchar *buf, int buf_len) case ITU_STANDARD: switch (itu_pc_structure) { case ITU_PC_STRUCTURE_NONE: - g_snprintf(buf, buf_len, "%u", pc); + snprintf(buf, buf_len, "%u", pc); break; case ITU_PC_STRUCTURE_3_8_3: /* this format is used in international ITU networks */ - g_snprintf(buf, buf_len, "%u-%u-%u", (pc & 0x3800)>>11, (pc & 0x7f8) >> 3, (pc & 0x07) >> 0); + snprintf(buf, buf_len, "%u-%u-%u", (pc & 0x3800)>>11, (pc & 0x7f8) >> 3, (pc & 0x07) >> 0); break; case ITU_PC_STRUCTURE_4_3_4_3: /* this format is used in some national ITU networks, the German one for example. */ - g_snprintf(buf, buf_len, "%u-%u-%u-%u", (pc & 0x3c00) >>10, (pc & 0x0380) >> 7, (pc & 0x0078) >> 3, (pc & 0x0007) >> 0); + snprintf(buf, buf_len, "%u-%u-%u-%u", (pc & 0x3c00) >>10, (pc & 0x0380) >> 7, (pc & 0x0078) >> 3, (pc & 0x0007) >> 0); break; default: DISSECTOR_ASSERT_NOT_REACHED(); @@ -249,20 +249,20 @@ mtp3_pc_to_str_buf(const guint32 pc, gchar *buf, int buf_len) break; case ANSI_STANDARD: case CHINESE_ITU_STANDARD: - g_snprintf(buf, buf_len, "%u-%u-%u", (pc & ANSI_NETWORK_MASK) >> 16, (pc & ANSI_CLUSTER_MASK) >> 8, (pc & ANSI_MEMBER_MASK)); + snprintf(buf, buf_len, "%u-%u-%u", (pc & ANSI_NETWORK_MASK) >> 16, (pc & ANSI_CLUSTER_MASK) >> 8, (pc & ANSI_MEMBER_MASK)); break; case JAPAN_STANDARD: switch (japan_pc_structure) { case JAPAN_PC_STRUCTURE_NONE: - g_snprintf(buf, buf_len, "%u", pc); + snprintf(buf, buf_len, "%u", pc); break; case JAPAN_PC_STRUCTURE_7_4_5: /* This format is specified by NTT */ - g_snprintf(buf, buf_len, "%u-%u-%u", (pc & 0xfe00)>>9, (pc & 0x1e0)>>5, (pc & 0x1f)); + snprintf(buf, buf_len, "%u-%u-%u", (pc & 0xfe00)>>9, (pc & 0x1e0)>>5, (pc & 0x1f)); break; case JAPAN_PC_STRUCTURE_3_4_4_5: /* Where does this format come from? */ - g_snprintf(buf, buf_len, "%u-%u-%u-%u", (pc & 0xe000)>>13, (pc & 0x1e00)>>9, (pc & 0x1e0)>>5, (pc & 0x1f)); + snprintf(buf, buf_len, "%u-%u-%u-%u", (pc & 0xe000)>>13, (pc & 0x1e00)>>9, (pc & 0x1e0)>>5, (pc & 0x1f)); break; default: DISSECTOR_ASSERT_NOT_REACHED(); @@ -310,14 +310,14 @@ mtp3_addr_to_str_buf(const mtp3_addr_pc_t *addr_pc_p, switch (addr_pc_p->type) { case ITU_STANDARD: - g_snprintf(buf, buf_len, "%u", addr_pc_p->pc & ITU_PC_MASK); + snprintf(buf, buf_len, "%u", addr_pc_p->pc & ITU_PC_MASK); break; case JAPAN_STANDARD: - g_snprintf(buf, buf_len, "%u", addr_pc_p->pc & JAPAN_PC_MASK); + snprintf(buf, buf_len, "%u", addr_pc_p->pc & JAPAN_PC_MASK); break; default: /* assuming 24-bit */ - g_snprintf(buf, buf_len, "%u", addr_pc_p->pc & ANSI_PC_MASK); + snprintf(buf, buf_len, "%u", addr_pc_p->pc & ANSI_PC_MASK); break; } break; @@ -326,14 +326,14 @@ mtp3_addr_to_str_buf(const mtp3_addr_pc_t *addr_pc_p, switch (addr_pc_p->type) { case ITU_STANDARD: - g_snprintf(buf, buf_len, "%x", addr_pc_p->pc & ITU_PC_MASK); + snprintf(buf, buf_len, "%x", addr_pc_p->pc & ITU_PC_MASK); break; case JAPAN_STANDARD: - g_snprintf(buf, buf_len, "%x", addr_pc_p->pc & JAPAN_PC_MASK); + snprintf(buf, buf_len, "%x", addr_pc_p->pc & JAPAN_PC_MASK); break; default: /* assuming 24-bit */ - g_snprintf(buf, buf_len, "%x", addr_pc_p->pc & ANSI_PC_MASK); + snprintf(buf, buf_len, "%x", addr_pc_p->pc & ANSI_PC_MASK); break; } break; @@ -342,14 +342,14 @@ mtp3_addr_to_str_buf(const mtp3_addr_pc_t *addr_pc_p, switch (addr_pc_p->type) { case ITU_STANDARD: - g_snprintf(buf, buf_len, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & ITU_PC_MASK); + snprintf(buf, buf_len, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & ITU_PC_MASK); break; case JAPAN_STANDARD: - g_snprintf(buf, buf_len, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & JAPAN_PC_MASK); + snprintf(buf, buf_len, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & JAPAN_PC_MASK); break; default: /* assuming 24-bit */ - g_snprintf(buf, buf_len, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & ANSI_PC_MASK); + snprintf(buf, buf_len, "%u:%u", addr_pc_p->ni, addr_pc_p->pc & ANSI_PC_MASK); break; } break; @@ -358,14 +358,14 @@ mtp3_addr_to_str_buf(const mtp3_addr_pc_t *addr_pc_p, switch (addr_pc_p->type) { case ITU_STANDARD: - g_snprintf(buf, buf_len, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & ITU_PC_MASK); + snprintf(buf, buf_len, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & ITU_PC_MASK); break; case JAPAN_STANDARD: - g_snprintf(buf, buf_len, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & JAPAN_PC_MASK); + snprintf(buf, buf_len, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & JAPAN_PC_MASK); break; default: /* assuming 24-bit */ - g_snprintf(buf, buf_len, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & ANSI_PC_MASK); + snprintf(buf, buf_len, "%u:%x", addr_pc_p->ni, addr_pc_p->pc & ANSI_PC_MASK); break; } break; @@ -459,11 +459,11 @@ dissect_mtp3_3byte_pc(tvbuff_t *tvb, guint offset, proto_tree *tree, gint ett_pc * NOTE: each of these formats is shown to the user, * so I think that using hidden fields in this case is OK. */ - g_snprintf(pc_string, sizeof(pc_string), "%u", pc); + snprintf(pc_string, sizeof(pc_string), "%u", pc); proto_item_append_text(pc_item, " (%s)", pc_string); hidden_item = proto_tree_add_string(tree, hf_pc_string, tvb, offset, ANSI_PC_LENGTH, pc_string); proto_item_set_hidden(hidden_item); - g_snprintf(pc_string, sizeof(pc_string), "0x%x", pc); + snprintf(pc_string, sizeof(pc_string), "0x%x", pc); proto_item_append_text(pc_item, " (%s)", pc_string); hidden_item = proto_tree_add_string(tree, hf_pc_string, tvb, offset, ANSI_PC_LENGTH, pc_string); proto_item_set_hidden(hidden_item); diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c index dd251ebfc8..343febb90d 100644 --- a/epan/dissectors/packet-mysql.c +++ b/epan/dissectors/packet-mysql.c @@ -2986,7 +2986,7 @@ dissect_mysql_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat if (tree) { pi = proto_tree_add_debug_text(mysql_tree, "conversation: %p", conversation); proto_item_set_generated(pi); - pi = proto_tree_add_debug_text(mysql_tree, "generation: %" G_GINT64_MODIFIER "d", generation); + pi = proto_tree_add_debug_text(mysql_tree, "generation: %" PRId64, generation); proto_item_set_generated(pi); pi = proto_tree_add_debug_text(mysql_tree, "conn state: %s (%u)", val_to_str(conn_state_in, state_vals, "Unknown (%u)"), diff --git a/epan/dissectors/packet-nas_5gs.c b/epan/dissectors/packet-nas_5gs.c index 7768af69e0..2d36513c0f 100644 --- a/epan/dissectors/packet-nas_5gs.c +++ b/epan/dissectors/packet-nas_5gs.c @@ -2521,16 +2521,16 @@ de_nas_5gs_mm_nssai_inc_mode(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo static void nas_5gs_mm_access_cat_number(gchar *s, guint32 val) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%u (%u)", 32+val, val); + snprintf(s, ITEM_LABEL_LENGTH, "%u (%u)", 32+val, val); } static void nas_5gs_mm_access_standardized_cat_number(gchar *s, guint32 val) { if (val <= 7) - g_snprintf(s, ITEM_LABEL_LENGTH, "%u", val); + snprintf(s, ITEM_LABEL_LENGTH, "%u", val); else - g_snprintf(s, ITEM_LABEL_LENGTH, "Reserved (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "Reserved (%u)", val); } static const value_string nas_5gs_mm_op_def_access_cat_criteria_type_vals[] = { diff --git a/epan/dissectors/packet-nas_eps.c b/epan/dissectors/packet-nas_eps.c index f750fa831a..20b8222aec 100644 --- a/epan/dissectors/packet-nas_eps.c +++ b/epan/dissectors/packet-nas_eps.c @@ -2930,9 +2930,9 @@ static void de_emm_wus_assist_info_ue_paging_prob_fmt(gchar *s, guint32 val) { if (val < 20) { - g_snprintf(s, ITEM_LABEL_LENGTH, "p%u (%u)", val*5, val); + snprintf(s, ITEM_LABEL_LENGTH, "p%u (%u)", val*5, val); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "p100 (%u)", val); + snprintf(s, ITEM_LABEL_LENGTH, "p100 (%u)", val); } } diff --git a/epan/dissectors/packet-nbd.c b/epan/dissectors/packet-nbd.c index 0f78149ba4..25c1b03607 100644 --- a/epan/dissectors/packet-nbd.c +++ b/epan/dissectors/packet-nbd.c @@ -316,10 +316,10 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, switch(nbd_trans->type){ case NBD_CMD_WRITE: - col_add_fstr(pinfo->cinfo, COL_INFO, "Write Request Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen); + col_add_fstr(pinfo->cinfo, COL_INFO, "Write Request Offset:0x%" PRIx64 " Length:%d", from, nbd_trans->datalen); break; case NBD_CMD_READ: - col_add_fstr(pinfo->cinfo, COL_INFO, "Read Request Offset:0x%" G_GINT64_MODIFIER "x Length:%d", from, nbd_trans->datalen); + col_add_fstr(pinfo->cinfo, COL_INFO, "Read Request Offset:0x%" PRIx64 " Length:%d", from, nbd_trans->datalen); break; case NBD_CMD_DISC: col_set_str(pinfo->cinfo, COL_INFO, "Disconnect Request"); diff --git a/epan/dissectors/packet-nbt.c b/epan/dissectors/packet-nbt.c index b80a6a53a7..abfae997a5 100644 --- a/epan/dissectors/packet-nbt.c +++ b/epan/dissectors/packet-nbt.c @@ -388,7 +388,7 @@ get_nbns_name(tvbuff_t *tvb, int offset, int nbns_data_offset, /* NetBIOS names are supposed to be exactly 16 bytes long. */ if (idx != NETBIOS_NAME_LEN) { /* It's not. */ - g_snprintf(nbname_buf, NBNAME_BUF_LEN, "Illegal NetBIOS name (%lu bytes long)", + snprintf(nbname_buf, NBNAME_BUF_LEN, "Illegal NetBIOS name (%lu bytes long)", (unsigned long)idx); goto bad; } @@ -397,11 +397,11 @@ get_nbns_name(tvbuff_t *tvb, int offset, int nbns_data_offset, name_type = process_netbios_name(nbname, name_ret, name_ret_len); pname_ret += MIN(strlen(name_ret), (size_t) name_ret_len); pname_ret += MIN(name_ret_len-(pname_ret-name_ret), - g_snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "<%02x>", name_type)); + snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "<%02x>", name_type)); if (cname == '.') { /* We have a scope ID, starting at "pname"; append that to * the decoded host name. */ - g_snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "%s", pname); + snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "%s", pname); } if (name_type_ret != NULL) *name_type_ret = name_type; @@ -412,7 +412,7 @@ bad: *name_type_ret = -1; /* This is only valid because nbname is always assigned an error string * before jumping to bad: Otherwise nbname wouldn't be \0 terminated */ - g_snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "%s", nbname); + snprintf(pname_ret, name_ret_len-(gulong)(pname_ret-name_ret), "%s", nbname); return used_bytes; } diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc index 0c3c5c7045..37c28d4d07 100644 --- a/epan/dissectors/packet-ncp2222.inc +++ b/epan/dissectors/packet-ncp2222.inc @@ -2445,13 +2445,19 @@ add_ptvc_field(packet_info* pinfo, ptvcursor_t *ptvc, const ptvc_record *rec, gb static void padd_date( gchar *result, guint32 date_value ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%04u/%02u/%02u", ((date_value & 0xfe00) >> 9) + 1980, (date_value & 0x01e0) >> 5, date_value & 0x001f); + snprintf(result, ITEM_LABEL_LENGTH, "%04u/%02u/%02u", + ((date_value & 0xfe00) >> 9) + 1980, + (date_value & 0x01e0) >> 5, + date_value & 0x001f); } static void padd_time( gchar *result, guint32 time_value ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%02u:%02u:%02u", ((time_value & 0xf800) >> 11), ((time_value & 0x07e0) >> 5), (time_value & 0x001f) * 2); + snprintf(result, ITEM_LABEL_LENGTH, "%02u:%02u:%02u", + ((time_value & 0xf800) >> 11), + ((time_value & 0x07e0) >> 5), + (time_value & 0x001f) * 2); } /* Add a value for a ptvc_record, and process the sub-ptvc_record diff --git a/epan/dissectors/packet-netanalyzer.c b/epan/dissectors/packet-netanalyzer.c index 3447809efb..bce389faa6 100644 --- a/epan/dissectors/packet-netanalyzer.c +++ b/epan/dissectors/packet-netanalyzer.c @@ -348,7 +348,7 @@ dissect_netanalyzer_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ti = proto_tree_add_item (netanalyzer_header_tree, hf_netanalyzer_gpio_edge, tvb, offset, 1, ENC_LITTLE_ENDIAN); gpio_edge = (tvb_get_guint8(tvb, offset) & 0x01); - g_snprintf(szTemp, MAX_BUFFER, + snprintf(szTemp, MAX_BUFFER, "GPIO event on GPIO %d (%sing edge)", gpio_num, (gpio_edge == 0x00) ? "ris" : "fall"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s", szTemp); diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c index 79c4343672..b1521273e1 100644 --- a/epan/dissectors/packet-netflow.c +++ b/epan/dissectors/packet-netflow.c @@ -7922,7 +7922,7 @@ dissect_v9_v10_pdu_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdutree, /* need to add custom code to show "Not Measured" */ proto_tree_add_expert_format(pdutree, NULL, &ei_transport_bytes_out_of_order, tvb, offset, 8, - "Transport Bytes Out of Order: Not Measured (0x%"G_GINT64_MODIFIER"x)", + "Transport Bytes Out of Order: Not Measured (0x%"PRIx64")", tvb_get_ntoh64(tvb, offset)); ti = proto_tree_add_item(pdutree, hf_cflow_transport_bytes_out_of_order, tvb, offset, length, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-netlink-net_dm.c b/epan/dissectors/packet-netlink-net_dm.c index 77a9f6084a..77ff65f39e 100644 --- a/epan/dissectors/packet-netlink-net_dm.c +++ b/epan/dissectors/packet-netlink-net_dm.c @@ -251,7 +251,7 @@ dissect_net_dm_attrs(tvbuff_t *tvb, void *data, struct packet_netlink_data *nl_d case WS_NET_DM_ATTR_PC: proto_tree_add_item_ret_uint64(tree, hf_net_dm_pc, tvb, offset, 8, nl_data->encoding, &pc); - proto_item_append_text(tree, ": 0x%" G_GINT64_MODIFIER "x", pc); + proto_item_append_text(tree, ": 0x%" PRIx64, pc); return 1; case WS_NET_DM_ATTR_SYMBOL: proto_tree_add_item_ret_string(tree, hf_net_dm_symbol, tvb, offset, len, ENC_ASCII | ENC_NA, wmem_packet_scope(), &str); diff --git a/epan/dissectors/packet-netlink-psample.c b/epan/dissectors/packet-netlink-psample.c index b5a6f24e2f..dea18de671 100644 --- a/epan/dissectors/packet-netlink-psample.c +++ b/epan/dissectors/packet-netlink-psample.c @@ -166,11 +166,11 @@ dissect_psample_attrs(tvbuff_t *tvb, void *data, struct packet_netlink_data *nl_ return 1; case WS_PSAMPLE_ATTR_OUT_TC_OCC: proto_tree_add_item_ret_uint64(tree, hf_psample_out_tc_occ, tvb, offset, len, nl_data->encoding, &value64); - proto_item_append_text(tree, ": %"G_GUINT64_FORMAT, value64); + proto_item_append_text(tree, ": %"PRIu64, value64); return 1; case WS_PSAMPLE_ATTR_LATENCY: proto_tree_add_item_ret_uint64(tree, hf_psample_latency, tvb, offset, len, nl_data->encoding, &value64); - proto_item_append_text(tree, ": %"G_GUINT64_FORMAT, value64); + proto_item_append_text(tree, ": %"PRIu64, value64); return 1; case WS_PSAMPLE_ATTR_TIMESTAMP: timestamp = tvb_get_guint64(tvb, offset, nl_data->encoding); diff --git a/epan/dissectors/packet-netlink-route.c b/epan/dissectors/packet-netlink-route.c index 0799ede701..7fb677072b 100644 --- a/epan/dissectors/packet-netlink-route.c +++ b/epan/dissectors/packet-netlink-route.c @@ -470,7 +470,7 @@ _fill_label_value_string_bitmask(char *label, guint32 value, const value_string if (value) { if (label[0]) (void) g_strlcat(label, ", ", ITEM_LABEL_LENGTH); - g_snprintf(tmp, sizeof(tmp), "0x%x", value); + snprintf(tmp, sizeof(tmp), "0x%x", value); (void) g_strlcat(label, tmp, ITEM_LABEL_LENGTH); } } @@ -517,7 +517,7 @@ hf_netlink_route_ifi_flags_label(char *label, guint32 value) _fill_label_value_string_bitmask(label, value, iff_vals); - g_snprintf(tmp, sizeof(tmp), " (0x%.8x)", value); + snprintf(tmp, sizeof(tmp), " (0x%.8x)", value); (void) g_strlcat(label, tmp, ITEM_LABEL_LENGTH); } @@ -824,7 +824,7 @@ netlink_route_ifa_flags_label(char *label, guint32 value) _fill_label_value_string_bitmask(label, value, iff_vals); - g_snprintf(tmp, sizeof(tmp), " (0x%.8x)", value); + snprintf(tmp, sizeof(tmp), " (0x%.8x)", value); (void) g_strlcat(label, tmp, ITEM_LABEL_LENGTH); } @@ -1085,7 +1085,7 @@ netlink_route_nd_states_label(char *label, guint32 value) _fill_label_value_string_bitmask(label, value, flags_vals); - g_snprintf(tmp, sizeof(tmp), " (0x%.4x)", value); + snprintf(tmp, sizeof(tmp), " (0x%.4x)", value); (void) g_strlcat(label, tmp, ITEM_LABEL_LENGTH); } diff --git a/epan/dissectors/packet-netmon.c b/epan/dissectors/packet-netmon.c index 25636443b4..b4d7782ce1 100644 --- a/epan/dissectors/packet-netmon.c +++ b/epan/dissectors/packet-netmon.c @@ -691,19 +691,19 @@ dissect_netmon_network_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } else if (link_speed >= 1000 * 1000 * 1000) { - proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" G_GINT64_MODIFIER "u Gbps", link_speed/(1000*1000*1000)); + proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" PRIu64 " Gbps", link_speed/(1000*1000*1000)); } else if (link_speed >= 1000 * 1000) { - proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" G_GINT64_MODIFIER "u Mbps", link_speed/(1000*1000)); + proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" PRIu64 " Mbps", link_speed/(1000*1000)); } else if (link_speed >= 1000) { - proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" G_GINT64_MODIFIER "u Kbps", link_speed/1000); + proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" PRIu64 " Kbps", link_speed/1000); } else { - proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" G_GINT64_MODIFIER "u bps", link_speed); + proto_tree_add_uint64_format_value(adapter_tree, hf_netmon_network_info_link_speed, tvb, offset, 8, link_speed, "%" PRIu64 " bps", link_speed); } offset += 8; proto_tree_add_item(adapter_tree, hf_netmon_network_info_mac_address, tvb, offset, 6, ENC_NA); diff --git a/epan/dissectors/packet-nfapi.c b/epan/dissectors/packet-nfapi.c index 2fef163466..0f6a9922d9 100644 --- a/epan/dissectors/packet-nfapi.c +++ b/epan/dissectors/packet-nfapi.c @@ -8588,53 +8588,53 @@ static void nfapi_tag_vals_fn(gchar* s, guint32 v) const tlv_t* tlv = look_up_tlv(v); if (tlv != 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", tlv->name, v); + snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", tlv->name, v); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", "Unknown", v); + snprintf(s, ITEM_LABEL_LENGTH, "%s (0x%x)", "Unknown", v); } } static void neg_pow_conversion_fn(gchar* s, guint8 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d dB (%d)", ((gint16)v * (-1)), v); + snprintf(s, ITEM_LABEL_LENGTH, "%d dB (%d)", ((gint16)v * (-1)), v); } static void power_offset_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v * 0.001) - 6.0), v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v * 0.001) - 6.0), v); } static void reference_signal_power_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v * 0.25) - 63.75), v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v * 0.25) - 63.75), v); } static void laa_threshold_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (float)(v * -100.00), v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (float)(v * -100.00), v); } static void max_transmit_power_2_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1) - 10.0, v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1) - 10.0, v); } static void max_transmit_power_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v); } static void sfn_sf_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d/%d (%d)", v >> 0x4, v & 0x000F, v); + snprintf(s, ITEM_LABEL_LENGTH, "%d/%d (%d)", v >> 0x4, v & 0x000F, v); } static void rssi_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v); } static void dl_rs_tx_pow_measment_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", ((float)v * 0.1), v); } static void ul_cqi_conversion_fn(gchar* s, guint16 v) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v / 2 ) - 64.0), v); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f dB (%d)", (((float)v / 2 ) - 64.0), v); } // ----------------------------------------------------------------------------| diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 5d79eb7911..61a9be0b5a 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -1047,7 +1047,7 @@ static int dissect_nfs4_stateid(tvbuff_t *tvb, int offset, proto_tree *tree, gui static void nfs_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode NFS file handles as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Decode NFS file handles as"); } /* This function will store one nfs filehandle in our global tree of @@ -1298,7 +1298,7 @@ nfs_full_name_snoop(packet_info *pinfo, nfs_name_snoop_t *nns, int *len, char ** *name = (char *)g_malloc((*len)+1); *pos = *name; - *pos += g_snprintf(*pos, (*len)+1, "%s", nns->name); + *pos += snprintf(*pos, (*len)+1, "%s", nns->name); DISSECTOR_ASSERT((*pos-*name) <= *len); return; } @@ -1320,7 +1320,7 @@ nfs_full_name_snoop(packet_info *pinfo, nfs_name_snoop_t *nns, int *len, char ** nfs_full_name_snoop(pinfo, parent_nns, len, name, pos); if (*name) { /* make sure components are '/' separated */ - *pos += g_snprintf(*pos, (*len+1) - (gulong)(*pos-*name), "%s%s", + *pos += snprintf(*pos, (*len+1) - (gulong)(*pos-*name), "%s%s", ((*pos)[-1] != '/')?"/":"", nns->name); DISSECTOR_ASSERT((*pos-*name) <= *len); } @@ -1439,7 +1439,7 @@ nfs_fmt_fsid( gchar *result, guint32 revision ) fsid_major = ( revision>>18 ) & 0x3fff; /* 14 bits */ fsid_minor = ( revision ) & 0x3ffff; /* 18 bits */ - g_snprintf( result, ITEM_LABEL_LENGTH, "%d,%d", fsid_major, fsid_minor); + snprintf( result, ITEM_LABEL_LENGTH, "%d,%d", fsid_major, fsid_minor); } /* SVR4: checked with ReliantUNIX (5.43, 5.44, 5.45), OpenSolaris (build 101a) */ @@ -4981,9 +4981,9 @@ dissect_nfs3_read_call(tvbuff_t *tvb, packet_info *pinfo, col_append_fstr(pinfo->cinfo, COL_INFO, - ", FH: 0x%08x Offset: %" G_GINT64_MODIFIER "u Len: %u", hash, off, len); + ", FH: 0x%08x Offset: %" PRIu64 " Len: %u", hash, off, len); proto_item_append_text(tree, - ", READ Call FH: 0x%08x Offset: %" G_GINT64_MODIFIER "u Len: %u", hash, off, len); + ", READ Call FH: 0x%08x Offset: %" PRIu64 " Len: %u", hash, off, len); return offset; } @@ -5066,9 +5066,9 @@ dissect_nfs3_write_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi stable = tvb_get_ntohl(tvb, offset); offset = dissect_stable_how(tvb, offset, tree, hf_nfs3_write_stable); - col_append_fstr(pinfo->cinfo, COL_INFO, ", FH: 0x%08x Offset: %" G_GINT64_MODIFIER "u Len: %u %s", + col_append_fstr(pinfo->cinfo, COL_INFO, ", FH: 0x%08x Offset: %" PRIu64 " Len: %u %s", hash, off, len, val_to_str(stable, names_stable_how, "Stable: %u")); - proto_item_append_text(tree, ", WRITE Call FH: 0x%08x Offset: %" G_GINT64_MODIFIER "u Len: %u %s", + proto_item_append_text(tree, ", WRITE Call FH: 0x%08x Offset: %" PRIu64 " Len: %u %s", hash, off, len, val_to_str(stable, names_stable_how, "Stable: %u")); offset = dissect_nfsdata (tvb, offset, tree, hf_nfs_data); @@ -7113,7 +7113,7 @@ dissect_nfs4_threshold_item_file(tvbuff_t *tvb, int offset, packet_info *pinfo _ case TH4_WRITE_IOSIZE: size = tvb_get_ntoh64(tvb, offset); offset = dissect_rpc_uint64(tvb, attr_tree, hf_nfs4_length, offset); - proto_item_append_text(attr_tree, " = %" G_GUINT64_FORMAT, size); + proto_item_append_text(attr_tree, " = %" PRIu64, size); break; } return offset; @@ -9941,7 +9941,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre length = tvb_get_ntohl(tvb, offset); offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_count, offset); wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " FH: 0x%08x Offset: %"G_GINT64_MODIFIER"u Len: %u", + " FH: 0x%08x Offset: %"PRIu64" Len: %u", last_fh_hash, file_offset, length); break; @@ -10013,11 +10013,11 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_nfs4_locker(tvb, offset, newftree); if (length64 == G_GUINT64_CONSTANT(0xffffffffffffffff)) wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " FH: 0x%08x Offset: %"G_GINT64_MODIFIER"u Length: ", + " FH: 0x%08x Offset: %"PRIu64" Length: ", last_fh_hash, file_offset); else wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " FH: 0x%08x Offset: %"G_GINT64_MODIFIER"u Length: %"G_GINT64_MODIFIER"u ", + " FH: 0x%08x Offset: %"PRIu64" Length: %"PRIu64" ", last_fh_hash, file_offset, length64); break; @@ -10038,11 +10038,11 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_length, offset); if (length64 == G_GUINT64_CONSTANT(0xffffffffffffffff)) wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " FH: 0x%08x Offset: %"G_GINT64_MODIFIER"u Length: ", + " FH: 0x%08x Offset: %"PRIu64" Length: ", last_fh_hash, file_offset); else wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " FH: 0x%08x Offset: %"G_GINT64_MODIFIER"u Length: %"G_GINT64_MODIFIER"u ", + " FH: 0x%08x Offset: %"PRIu64" Length: %"PRIu64 " ", last_fh_hash, file_offset, length64); break; @@ -10117,7 +10117,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_count, offset); if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " StateID: 0x%04x Offset: %" G_GINT64_MODIFIER "u Len: %u", + " StateID: 0x%04x Offset: %" PRIu64 " Len: %u", sid_hash, file_offset, length); break; @@ -10164,7 +10164,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre case NFS4_OP_RENEW: clientid = tvb_get_ntoh64(tvb, offset); offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_clientid, offset); - wmem_strbuf_append_printf (op_summary[ops_counter].optext, " CID: 0x%016"G_GINT64_MODIFIER"x", clientid); + wmem_strbuf_append_printf (op_summary[ops_counter].optext, " CID: 0x%016"PRIx64, clientid); break; @@ -10229,7 +10229,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_nfsdata(tvb, offset, newftree, hf_nfs_data); if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " StateID: 0x%04x Offset: %"G_GINT64_MODIFIER"u Len: %u", + " StateID: 0x%04x Offset: %"PRIu64" Len: %u", sid_hash, file_offset, string_length); break; @@ -10342,8 +10342,8 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " StateID: 0x%04x" - " Offset: %" G_GINT64_MODIFIER "u" - " Len: %" G_GINT64_MODIFIER "u", + " Offset: %" PRIu64 + " Len: %" PRIu64, sid_hash, file_offset, length64); break; @@ -10360,8 +10360,8 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " Src StateID: 0x%04x" - " Offset: %" G_GINT64_MODIFIER "u" - " Len: %" G_GINT64_MODIFIER "u", + " Offset: %" PRIu64 + " Len: %" PRIu64, sid_hash, file_offset, length64); offset = dissect_rpc_bool(tvb, newftree, hf_nfs4_consecutive, offset); @@ -10372,7 +10372,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre if (dst_sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " Dst StateID: 0x%04x" - " Offset: %" G_GINT64_MODIFIER "u", + " Offset: %" PRIu64, dst_sid_hash, dst_file_offset); offset = dissect_nfs4_source_servers(tvb, offset, newftree); @@ -10398,8 +10398,8 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " StateID: 0x%04x" - " Offset: %" G_GINT64_MODIFIER "u" - " Len: %" G_GINT64_MODIFIER "u", + " Offset: %" PRIu64 + " Len: %" PRIu64, sid_hash, file_offset, length64); break; @@ -10412,8 +10412,8 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " StateID: 0x%04x" - " Offset: %" G_GINT64_MODIFIER "u" - " Len: %" G_GINT64_MODIFIER "u", + " Offset: %" PRIu64 + " Len: %" PRIu64, sid_hash, file_offset, length64); offset = dissect_nfs4_io_hints(tvb, offset, pinfo, tree); break; @@ -10442,7 +10442,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_rpc_uint32(tvb, newftree, hf_nfs4_count, offset); if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " StateID: 0x%04x Offset: %" G_GINT64_MODIFIER "u Len: %u", + " StateID: 0x%04x Offset: %" PRIu64 " Len: %u", sid_hash, file_offset, length); break; @@ -10454,7 +10454,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_nfs4_stateid(tvb, offset, newftree, &sid_hash); if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " StateID: 0x%04x Offset: %" G_GINT64_MODIFIER "u Len: %u", + " StateID: 0x%04x Offset: %" PRIu64 " Len: %u", sid_hash, file_offset, length); offset = dissect_nfs4_device_errors(tvb, offset, newftree); break; @@ -10467,7 +10467,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset = dissect_nfs4_stateid(tvb, offset, newftree, &sid_hash); if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, - " StateID: 0x%04x Offset: %" G_GINT64_MODIFIER "u Len: %u", + " StateID: 0x%04x Offset: %" PRIu64 " Len: %u", sid_hash, file_offset, length); offset = dissect_nfs4_layoutstats(tvb, offset, pinfo, newftree, civ, TRUE); break; @@ -10481,7 +10481,7 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre offset += 4; if (sid_hash != 0) wmem_strbuf_append_printf(op_summary[ops_counter].optext, - " StateID: 0x%04x Offset: %" G_GINT64_MODIFIER "u", + " StateID: 0x%04x Offset: %" PRIu64, sid_hash, file_offset); break; @@ -10506,14 +10506,14 @@ dissect_nfs4_request_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tre if (sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " Src StateID: 0x%04x" - " Offset: %" G_GINT64_MODIFIER "u" - " Len: %" G_GINT64_MODIFIER "u", + " Offset: %" PRIu64 + " Len: %" PRIu64, sid_hash, file_offset, length64); if (dst_sid_hash != 0) wmem_strbuf_append_printf (op_summary[ops_counter].optext, " Dst StateID: 0x%04x" - " Offset: %" G_GINT64_MODIFIER "u", + " Offset: %" PRIu64, dst_sid_hash, dst_file_offset); break; diff --git a/epan/dissectors/packet-nlm.c b/epan/dissectors/packet-nlm.c index 4b4fb22dfb..1b7251d06e 100644 --- a/epan/dissectors/packet-nlm.c +++ b/epan/dissectors/packet-nlm.c @@ -345,7 +345,7 @@ dissect_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int version, i offset = dissect_rpc_uint32(tvb, lock_tree, hf_nlm_lock_l_len, offset); } - col_append_fstr(pinfo->cinfo, COL_INFO, " pos:%" G_GINT64_MODIFIER "u-%" G_GINT64_MODIFIER "u", start_offset, end_offset); + col_append_fstr(pinfo->cinfo, COL_INFO, " pos:%" PRIu64 "-%" PRIu64, start_offset, end_offset); return offset; } diff --git a/epan/dissectors/packet-noe.c b/epan/dissectors/packet-noe.c index 02313780eb..2c78421541 100644 --- a/epan/dissectors/packet-noe.c +++ b/epan/dissectors/packet-noe.c @@ -993,15 +993,15 @@ static char *decode_key_name(int unicode) || (unicode == 0xE9) || (unicode == 0xF9)) { - g_snprintf(key_name, 24, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown")); + snprintf(key_name, 24, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown")); } else if (unicode <= 0xFF) { - g_snprintf(key_name, 24, "%c", unicode); + snprintf(key_name, 24, "%c", unicode); } else { - g_snprintf(key_name, 24, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown")); + snprintf(key_name, 24, "%s", val_to_str_ext_const(unicode, &str_key_name_ext, "Unknown")); } return key_name; } @@ -1252,7 +1252,7 @@ static void decode_evt(proto_tree *tree, } unicode_value = decode_utf8(utf8_value); key_name = (char *)wmem_alloc(wmem_packet_scope(), 30); - g_snprintf(key_name, 30, "\"%s\"", decode_key_name((int)unicode_value)); + snprintf(key_name, 30, "\"%s\"", decode_key_name((int)unicode_value)); /* add text to the frame "INFO" column */ col_append_fstr(pinfo->cinfo, COL_INFO, ": %s", key_name); @@ -1264,7 +1264,7 @@ static void decode_evt(proto_tree *tree, tvb, offset, length, key_name, - "%s (UTF-8 Value: %s, Unicode Value: 0x%" G_GINT64_MODIFIER "x)", + "%s (UTF-8 Value: %s, Unicode Value: 0x%" PRIx64 ")", key_name, tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, length), unicode_value); diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c index 36e3832dda..5d79520d5c 100644 --- a/epan/dissectors/packet-ntlmssp.c +++ b/epan/dissectors/packet-ntlmssp.c @@ -522,7 +522,7 @@ get_md4pass_list(wmem_allocator_t *pool if (memcmp(nt_password_hash, gbl_zeros, NTLMSSP_KEY_LEN) != 0) { memcpy(pass_list[i].md4, nt_password_hash, NTLMSSP_KEY_LEN); - g_snprintf(pass_list[i].key_origin, NTLMSSP_MAX_ORIG_LEN, + snprintf(pass_list[i].key_origin, NTLMSSP_MAX_ORIG_LEN, ""); i = 1; } diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index 5e9cfe0c69..55a33ed086 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -1060,7 +1060,7 @@ tvb_ntp_fmt_ts_sec(tvbuff_t *tvb, gint offset) } buff = (char *)wmem_alloc(wmem_packet_scope(), NTP_TS_SIZE); - g_snprintf(buff, NTP_TS_SIZE, + snprintf(buff, NTP_TS_SIZE, "%s %2d, %d %02d:%02d:%02d UTC", mon_names[bd->tm_mon], bd->tm_mday, @@ -1254,11 +1254,11 @@ dissect_ntp_std(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ntp_tree, ntp_con */ buff = (gchar *)wmem_alloc(wmem_packet_scope(), NTP_TS_SIZE); if (stratum <= 1) { - g_snprintf (buff, NTP_TS_SIZE, "Unidentified reference source '%s'", + snprintf (buff, NTP_TS_SIZE, "Unidentified reference source '%s'", tvb_get_string_enc(wmem_packet_scope(), tvb, 12, 4, ENC_ASCII)); for (i = 0; primary_sources[i].id; i++) { if (tvb_memeql(tvb, 12, primary_sources[i].id, 4) == 0) { - g_snprintf(buff, NTP_TS_SIZE, "%s", + snprintf(buff, NTP_TS_SIZE, "%s", primary_sources[i].data); break; } @@ -1266,7 +1266,7 @@ dissect_ntp_std(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ntp_tree, ntp_con } else { int buffpos; refid_addr = tvb_get_ipv4(tvb, 12); - buffpos = g_snprintf(buff, NTP_TS_SIZE, "%s", get_hostname (refid_addr)); + buffpos = snprintf(buff, NTP_TS_SIZE, "%s", get_hostname (refid_addr)); if (buffpos >= NTP_TS_SIZE) { buff[NTP_TS_SIZE-4]='.'; buff[NTP_TS_SIZE-3]='.'; diff --git a/epan/dissectors/packet-nvme-rdma.c b/epan/dissectors/packet-nvme-rdma.c index 90e8362109..f93c13c094 100644 --- a/epan/dissectors/packet-nvme-rdma.c +++ b/epan/dissectors/packet-nvme-rdma.c @@ -259,12 +259,12 @@ find_ib_cm_conversation(packet_info *pinfo) static void add_rdma_cm_qid(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (%s)", val, val ? "IOQ" : "AQ"); + snprintf(result, ITEM_LABEL_LENGTH, "%x (%s)", val, val ? "IOQ" : "AQ"); } static void add_zero_base(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%u", val+1); + snprintf(result, ITEM_LABEL_LENGTH, "%u", val+1); } static void dissect_rdma_cm_req_packet(tvbuff_t *tvb, proto_tree *tree) diff --git a/epan/dissectors/packet-nvme.c b/epan/dissectors/packet-nvme.c index 525aa41db3..2be5ff25f5 100644 --- a/epan/dissectors/packet-nvme.c +++ b/epan/dissectors/packet-nvme.c @@ -1430,7 +1430,7 @@ static void add_group_mask_entry(tvbuff_t *tvb, proto_tree *tree, guint offset, static void add_ctrl_x16_bytes( gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (%u bytes)", val, val * 16); + snprintf(result, ITEM_LABEL_LENGTH, "%x (%u bytes)", val, val * 16); } static void dissect_nvme_identify_ctrl_resp_nvmeof(tvbuff_t *cmd_tvb, proto_tree *cmd_tree) @@ -1525,23 +1525,23 @@ static void dissect_nvme_identify_ctrl_resp_power_state_descriptors(tvbuff_t *cm static void add_ctrl_rab(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%"G_GUINT64_FORMAT" command%s)", val, ((guint64)1) << val, val ? "s" : ""); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%"PRIu64" command%s)", val, ((guint64)1) << val, val ? "s" : ""); } static void add_ctrl_mdts(gchar *result, guint32 val) { if (val) - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%"G_GUINT64_FORMAT" pages)", val, ((guint64)1) << val); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%"PRIu64" pages)", val, ((guint64)1) << val); else - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x (unlimited)", val); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x (unlimited)", val); } static void add_ctrl_rtd3(gchar *result, guint32 val) { if (!val) - g_snprintf(result, ITEM_LABEL_LENGTH, "0 (not reported)"); + snprintf(result, ITEM_LABEL_LENGTH, "0 (not reported)"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%u (%u microsecond%s)", val, val, (val > 1) ? "%s" : ""); + snprintf(result, ITEM_LABEL_LENGTH, "%u (%u microsecond%s)", val, val, (val > 1) ? "%s" : ""); } static const value_string ctrl_type_tbl[] = { @@ -1554,7 +1554,7 @@ static const value_string ctrl_type_tbl[] = { static void add_ctrl_ms(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%u (%u ms)", val, val * 100); + snprintf(result, ITEM_LABEL_LENGTH, "%u (%u ms)", val, val * 100); } static void dissect_nvme_identify_ctrl_resp_ver(tvbuff_t *cmd_tvb, proto_tree *cmd_tree) @@ -1597,27 +1597,27 @@ static void dissect_nvme_identify_ctrl_resp_mi(tvbuff_t *cmd_tvb, proto_tree *cm static void add_ctrl_commands(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u command%s)", val, val+1, val ? "s" : ""); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u command%s)", val, val+1, val ? "s" : ""); } static void add_ctrl_events(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u event%s)", val, val+1, val ? "s" : ""); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u event%s)", val, val+1, val ? "s" : ""); } static void add_ctrl_entries(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u entr%s)", val, val+1, val ? "ies" : "y"); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u entr%s)", val, val+1, val ? "ies" : "y"); } static void add_ctrl_states(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u state%s)", val, val+1, val ? "s" : ""); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x: (%u state%s)", val, val+1, val ? "s" : ""); } static void add_ctrl_hmpre(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%"G_GUINT64_FORMAT" bytes)", val, ((guint64)(val)) * 4096); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%"PRIu64" bytes)", val, ((guint64)(val)) * 4096); } static void post_add_bytes_from_16bytes(proto_item *ti, tvbuff_t *tvb, guint off, guint8 shiftl) @@ -1632,30 +1632,30 @@ static void post_add_bytes_from_16bytes(proto_item *ti, tvbuff_t *tvb, guint off } if (hi) { if (!(hi >> 10)) - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " KiB)", (hi << 54) | (lo >> 10)); + proto_item_append_text(ti, " (%" PRIu64 " KiB)", (hi << 54) | (lo >> 10)); else if (!(hi >> 20)) - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " MiB)", (hi << 44) | (lo >> 20)); + proto_item_append_text(ti, " (%" PRIu64 " MiB)", (hi << 44) | (lo >> 20)); else if (!(hi >> 30)) - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " GiB)", (hi << 34) | (lo >> 30)); + proto_item_append_text(ti, " (%" PRIu64 " GiB)", (hi << 34) | (lo >> 30)); else if (!(hi >> 40)) - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " TiB)", (hi << 24) | (lo >> 40)); + proto_item_append_text(ti, " (%" PRIu64 " TiB)", (hi << 24) | (lo >> 40)); else if (!(hi >> 50)) - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " PiB)", (hi << 14) | (lo >> 50)); + proto_item_append_text(ti, " (%" PRIu64 " PiB)", (hi << 14) | (lo >> 50)); else if (!(hi >> 60)) - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " EiB)", (hi << 4) | (lo >> 60)); + proto_item_append_text(ti, " (%" PRIu64 " EiB)", (hi << 4) | (lo >> 60)); else - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " ZiB)", hi >> 6); + proto_item_append_text(ti, " (%" PRIu64 " ZiB)", hi >> 6); } else { - proto_item_append_text(ti, " (%" G_GUINT64_FORMAT " bytes)", lo); + proto_item_append_text(ti, " (%" PRIu64 " bytes)", lo); } } static void add_ctrl_tmt(gchar *result, guint32 val) { if (!val) - g_snprintf(result, ITEM_LABEL_LENGTH, "0 (not supported)"); + snprintf(result, ITEM_LABEL_LENGTH, "0 (not supported)"); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%u degrees K", val); + snprintf(result, ITEM_LABEL_LENGTH, "%u degrees K", val); } static const value_string mmas_type_tbl[] = { @@ -1667,17 +1667,17 @@ static const value_string mmas_type_tbl[] = { static void add_ctrl_pow2_bytes(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%" G_GUINT64_FORMAT" bytes)", val, ((guint64)1) << val); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%" PRIu64" bytes)", val, ((guint64)1) << val); } static void add_ctrl_pow2_page_size(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%" G_GUINT64_FORMAT" bytes)", val, ((guint64)1) << (12+val)); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%" PRIu64" bytes)", val, ((guint64)1) << (12+val)); } static void add_ctrl_pow2_dstrd_size(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%" G_GUINT64_FORMAT" bytes)", val, ((guint64)1) << (2+val)); + snprintf(result, ITEM_LABEL_LENGTH, "0x%x (%" PRIu64" bytes)", val, ((guint64)1) << (2+val)); } @@ -1692,7 +1692,7 @@ static const value_string fcb_type_tbl[] = { static void add_ctrl_lblocks(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%u logical block%s", val + 1, val ? "%s" : ""); + snprintf(result, ITEM_LABEL_LENGTH, "%u logical block%s", val + 1, val ? "%s" : ""); } static const value_string sgls_ify_type_tbl[] = { @@ -1887,7 +1887,7 @@ static const char *get_logpage_name(guint lid) static void add_logpage_lid(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%s (0x%x)", get_logpage_name(val), val); + snprintf(result, ITEM_LABEL_LENGTH, "%s (0x%x)", get_logpage_name(val), val); } static const value_string sec_type_tbl[] = { @@ -1969,7 +1969,7 @@ static void dissect_nvme_get_logpage_ify_rcrd_resp(tvbuff_t *cmd_tvb, proto_tree guint tr_type; ti = proto_tree_add_bytes_format(tree, hf_nvme_get_logpage_ify_rcrd, cmd_tvb, off, - (len < 1024) ? len : 1024, NULL, "Discovery Log Entry %"G_GUINT64_FORMAT" (DLE%"G_GUINT64_FORMAT")", rcrd, rcrd); + (len < 1024) ? len : 1024, NULL, "Discovery Log Entry %"PRIu64" (DLE%"PRIu64")", rcrd, rcrd); grp = proto_item_add_subtree(ti, ett_data); if (!roff) @@ -2494,7 +2494,7 @@ static void dissect_nvme_get_logpage_telemetry_resp(proto_item *ti, tvbuff_t *cm len -= poff; while (len >= 512) { proto_tree_add_bytes_format_value(grp, hf_nvme_get_logpage_telemetry_db, cmd_tvb, poff, 512, NULL, - "Telemetry %s data block %"G_GUINT64_FORMAT, pfx, next_block); + "Telemetry %s data block %"PRIu64, pfx, next_block); len -= 512; next_block++; poff += 512; @@ -3005,7 +3005,7 @@ static void dissect_nvme_get_logpage_cmd(tvbuff_t *cmd_tvb, proto_tree *cmd_tree add_group_mask_entry(cmd_tvb, cmd_tree, 40, 4, ASPEC(hf_nvme_get_logpage_dword10)); ti = proto_tree_add_item_ret_uint(cmd_tree, hf_nvme_get_logpage_numd, cmd_tvb, 42, 4, ENC_LITTLE_ENDIAN, &val); - proto_item_append_text(ti, " (%"G_GUINT64_FORMAT" bytes)", ((guint64)(val+1)) * 4); + proto_item_append_text(ti, " (%"PRIu64" bytes)", ((guint64)(val+1)) * 4); add_group_mask_entry(cmd_tvb, cmd_tree, 44, 4, ASPEC(hf_nvme_get_logpage_dword11)); @@ -3133,7 +3133,7 @@ static const value_string sf_wps[] = { static void add_nvme_queues(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (%u)", val, val+1); + snprintf(result, ITEM_LABEL_LENGTH, "%x (%u)", val, val+1); } static void dissect_nvme_set_features_dword11(tvbuff_t *cmd_tvb, proto_tree *cmd_tree, guint fid) @@ -3394,12 +3394,12 @@ dissect_nvme_data_response(tvbuff_t *nvme_tvb, packet_info *pinfo, proto_tree *r static void add_nvme_qid(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (%s)", val, val ? "IOQ" : "AQ"); + snprintf(result, ITEM_LABEL_LENGTH, "%x (%s)", val, val ? "IOQ" : "AQ"); } static void add_zero_base(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%u", val+1); + snprintf(result, ITEM_LABEL_LENGTH, "%u", val+1); } static @@ -3482,17 +3482,17 @@ static void dissect_nvmeof_fabric_prop_get_cmd(proto_tree *cmd_tree, tvbuff_t *c static void add_500ms_units(gchar *result, guint32 val) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (%u ms)", val, val * 500); + snprintf(result, ITEM_LABEL_LENGTH, "%x (%u ms)", val, val * 500); } static void add_ccap_css(gchar *result, guint32 val) { if (val & 0x1) - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (NVM IO Command Set)", val); + snprintf(result, ITEM_LABEL_LENGTH, "%x (NVM IO Command Set)", val); else if (val & 0x80) - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (Admin Command Set Only)", val); + snprintf(result, ITEM_LABEL_LENGTH, "%x (Admin Command Set Only)", val); else - g_snprintf(result, ITEM_LABEL_LENGTH, "%x (Reserved)", val); + snprintf(result, ITEM_LABEL_LENGTH, "%x (Reserved)", val); } static void dissect_nvmeof_fabric_prop_data(proto_tree *tree, tvbuff_t *tvb, guint off, guint prop_off, guint8 attr) diff --git a/epan/dissectors/packet-obex.c b/epan/dissectors/packet-obex.c index 9e349a33e1..4d874662c9 100644 --- a/epan/dissectors/packet-obex.c +++ b/epan/dissectors/packet-obex.c @@ -1063,9 +1063,9 @@ static void media_type_prompt(packet_info *pinfo, gchar* result) value_data = (gchar *) p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_MEDIA_TYPE); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Media Type %s as", (gchar *) value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Media Type %s as", (gchar *) value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown Media Type"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown Media Type"); } static gpointer media_type_value(packet_info *pinfo) @@ -1086,9 +1086,9 @@ static void obex_profile_prompt(packet_info *pinfo, gchar* result) value_data = (guint8 *) p_get_proto_data(pinfo->pool, pinfo, proto_obex, PROTO_DATA_OBEX_PROFILE); if (value_data) - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "OBEX Profile 0x%04x as", (guint) *value_data); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "OBEX Profile 0x%04x as", (guint) *value_data); else - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown OBEX Profile"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Unknown OBEX Profile"); } static gpointer obex_profile_value(packet_info *pinfo) diff --git a/epan/dissectors/packet-ocfs2.c b/epan/dissectors/packet-ocfs2.c index 94fbf19ca4..c0379a9807 100644 --- a/epan/dissectors/packet-ocfs2.c +++ b/epan/dissectors/packet-ocfs2.c @@ -439,7 +439,7 @@ static int dlm_cookie_handler(proto_tree *tree, tvbuff_t *tvb, guint offset, int node_idx = (guint8)((cookie >> 56) & G_GINT64_CONSTANT(0xff)); seq = cookie & G_GINT64_CONSTANT(0x00ffffffffffffff); - proto_item_append_text(item, " (%u:%" G_GINT64_MODIFIER "u)", node_idx, seq); + proto_item_append_text(item, " (%u:%" PRIu64 ")", node_idx, seq); return offset + 8; } @@ -628,7 +628,7 @@ static void dissect_dlm_migrate_lockres(proto_tree *tree, tvbuff_t *tvb, int off static void dlm_fmt_revision( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } #define DLM_QUERY_JOIN_REQUEST_OFF_DLMPROTO 4 diff --git a/epan/dissectors/packet-opa-mad.c b/epan/dissectors/packet-opa-mad.c index d8a084aa6b..eef6daa114 100644 --- a/epan/dissectors/packet-opa-mad.c +++ b/epan/dissectors/packet-opa-mad.c @@ -2584,93 +2584,93 @@ static gchar *opa_format_port_select_mask(tvbuff_t *tvb, gint offset, guint8 **p /* Custom Functions */ static void cf_opa_mad_swinfo_ar_frequency(gchar *buf, guint16 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", 2 ^ (value)*64); + snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", 2 ^ (value)*64); } static void cf_opa_mad_linkspeed(gchar *buf, guint16 value) { int len = 0; if (value & 0x1) /* 12.5 Gbps */ - len = g_snprintf(buf, ITEM_LABEL_LENGTH, "12.5"); + len = snprintf(buf, ITEM_LABEL_LENGTH, "12.5"); if (value & 0x2) /* 25.78125 Gbps */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s25.78125", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s25.78125", (len ? ", " : "")); if (len) - g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, " Gbps"); + snprintf(&buf[len], ITEM_LABEL_LENGTH - len, " Gbps"); else - g_snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); + snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); } static void cf_opa_mad_linkwidth(gchar *buf, guint16 value) { int len = 0; if (value & 0x1) /* 1x */ - len = g_snprintf(buf, ITEM_LABEL_LENGTH, "1X"); + len = snprintf(buf, ITEM_LABEL_LENGTH, "1X"); if (value & 0x2) /* 2x */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s2X", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s2X", (len ? ", " : "")); if (value & 0x4) /* 3x */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s3X", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s3X", (len ? ", " : "")); if (value & 0x8) /* 4x */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s4X", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s4X", (len ? ", " : "")); if (!len) - g_snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); + snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); } static void cf_opa_mad_portlinkmode(gchar *buf, guint16 value) { int len = 0; if (value & 0x1) /* Reserved */ - len = g_snprintf(buf, ITEM_LABEL_LENGTH, "Reserved"); + len = snprintf(buf, ITEM_LABEL_LENGTH, "Reserved"); if (value & 0x2) /* Ethernet */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sEthernet", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sEthernet", (len ? ", " : "")); if (value & 0x4) /* STL */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sSTL", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sSTL", (len ? ", " : "")); if (!len) - g_snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); + snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); } static void cf_opa_mad_portltpcrcmode(gchar *buf, guint16 value) { int len = 0; if (value & 0x1) /* 14-bit */ - len = g_snprintf(buf, ITEM_LABEL_LENGTH, "14-bit"); + len = snprintf(buf, ITEM_LABEL_LENGTH, "14-bit"); if (value & 0x2) /* 16-bit */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s16-bit", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s16-bit", (len ? ", " : "")); if (value & 0x4) /* 48-bit */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s48-bit overlapping", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s48-bit overlapping", (len ? ", " : "")); if (value & 0x8) /* 12 to 16 bit per lane */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s[12,16]-bit per lane", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s[12,16]-bit per lane", (len ? ", " : "")); if (len) - g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, " LTP CRC Mode"); + snprintf(&buf[len], ITEM_LABEL_LENGTH - len, " LTP CRC Mode"); else - g_snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); + snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); } static void cf_opa_mad_packetformat(gchar *buf, guint16 value) { int len = 0; if (value & 0x1) /* 8B */ - len = g_snprintf(buf, ITEM_LABEL_LENGTH, "8B"); + len = snprintf(buf, ITEM_LABEL_LENGTH, "8B"); if (value & 0x2) /* 9B */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s9B", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s9B", (len ? ", " : "")); if (value & 0x4) /* 10B */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s10B", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s10B", (len ? ", " : "")); if (value & 0x8) /* 16B */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s16B", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s16B", (len ? ", " : "")); if (len) - g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, " Format%s", (len > 4 ? "s" : "")); + snprintf(&buf[len], ITEM_LABEL_LENGTH - len, " Format%s", (len > 4 ? "s" : "")); else - g_snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); + snprintf(buf, ITEM_LABEL_LENGTH, "No State Change"); } static void cf_opa_mad_swcongestionsetting_controlmap(gchar *buf, guint32 value) { int len = 0; if (value & 0x1) /* Victim */ - len = g_snprintf(buf, ITEM_LABEL_LENGTH, "Victim"); + len = snprintf(buf, ITEM_LABEL_LENGTH, "Victim"); if (value & 0x2) /* Credit */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sCredit", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sCredit", (len ? ", " : "")); if (value & 0x4) /* Threshold & PacketSize */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sThreshold & PacketSize", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sThreshold & PacketSize", (len ? ", " : "")); if (value & 0x8) /* CS_threshold & CS_ReturnDelay */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sCS_threshold & CS_ReturnDelay", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sCS_threshold & CS_ReturnDelay", (len ? ", " : "")); if (value & 0x10) /* Marking Rate */ - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sMarking Rate", (len ? ", " : "")); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%sMarking Rate", (len ? ", " : "")); if (!len) - g_snprintf(buf, ITEM_LABEL_LENGTH, "No Valid Fields"); + snprintf(buf, ITEM_LABEL_LENGTH, "No Valid Fields"); } static void cf_opa_mad_32b_mask(gchar *buf, guint32 value) { @@ -2678,16 +2678,16 @@ static void cf_opa_mad_32b_mask(gchar *buf, guint32 value) guint32 i, mask; for (i = 0, mask = value; mask && i < 32 && len < ITEM_LABEL_LENGTH; i++, mask >>= 1) { if (mask & 1) { - len += g_snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s%u", (len ? ", " : ""), i); + len += snprintf(&buf[len], ITEM_LABEL_LENGTH - len, "%s%u", (len ? ", " : ""), i); } } if (!len) { - g_snprintf(buf, ITEM_LABEL_LENGTH, " "); + snprintf(buf, ITEM_LABEL_LENGTH, " "); } } static void cf_opa_mad_computed_pct10(gchar *buf, guint16 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%01u", value / 10, value % 10); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%01u", value / 10, value % 10); } /* Dissector Declarations */ diff --git a/epan/dissectors/packet-opa-snc.c b/epan/dissectors/packet-opa-snc.c index e511858e14..ca19f19d50 100644 --- a/epan/dissectors/packet-opa-snc.c +++ b/epan/dissectors/packet-opa-snc.c @@ -150,11 +150,11 @@ static expert_field ei_opa_snc_nobypass = EI_INIT; static void cf_opa_snc_dw_to_b(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u DWORDS, %u Bytes", value, value * 4); + snprintf(buf, ITEM_LABEL_LENGTH, "%u DWORDS, %u Bytes", value, value * 4); } static void cf_opa_snc_qw_to_b(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u QWORDS, %u Bytes", value, value * 8); + snprintf(buf, ITEM_LABEL_LENGTH, "%u QWORDS, %u Bytes", value, value * 8); } /* Dissector Declarations */ diff --git a/epan/dissectors/packet-opa.c b/epan/dissectors/packet-opa.c index 00138327d5..7b2c7c7064 100644 --- a/epan/dissectors/packet-opa.c +++ b/epan/dissectors/packet-opa.c @@ -541,7 +541,7 @@ static gint hf_opa_TIDRDMA_VerbsQP = -1; /* Custom Functions */ static void cf_opa_dw_to_b(gchar *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u DWORDS (%u Bytes)", value, value * 4); + snprintf(buf, ITEM_LABEL_LENGTH, "%u DWORDS (%u Bytes)", value, value * 4); } /* Dissector Declarations */ diff --git a/epan/dissectors/packet-optommp.c b/epan/dissectors/packet-optommp.c index 779a426ba2..e4942f24ac 100644 --- a/epan/dissectors/packet-optommp.c +++ b/epan/dissectors/packet-optommp.c @@ -377,7 +377,7 @@ static gint dissect_optommp(tvbuff_t *tvb, packet_info *pinfo, proto_tree guint64 destination_offset = 0; destination_offset = tvb_get_ntoh48(tvb, 6); col_add_fstr(pinfo->cinfo, COL_INFO, - " type: %s, dest_off: 0x%012" G_GINT64_MODIFIER "x", + " type: %s, dest_off: 0x%012" PRIx64, val_to_str(tcode, optommp_tcode_names, "Unknown (0x%02x)"), destination_offset); } @@ -408,7 +408,7 @@ static gint dissect_optommp(tvbuff_t *tvb, packet_info *pinfo, proto_tree guint64 destination_offset = 0; destination_offset = tvb_get_ntoh48(tvb, 6); proto_item_append_text(root_ti, - ", dest_off: 0x%012" G_GINT64_MODIFIER "x", + ", dest_off: 0x%012" PRIx64, destination_offset); } /* Add an expansion to the tree */ diff --git a/epan/dissectors/packet-oran.c b/epan/dissectors/packet-oran.c index 7a3605a7bc..b35a3d6339 100644 --- a/epan/dissectors/packet-oran.c +++ b/epan/dissectors/packet-oran.c @@ -440,7 +440,7 @@ static void write_pdu_label_and_info(proto_item *ti1, proto_item *ti2, } va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); /* Add to indicated places */ @@ -493,7 +493,7 @@ addPcOrRtcid(tvbuff_t *tvb, proto_tree *tree, gint *offset, const char *name) proto_item_append_text(item, " (DU_Port_ID: %d, A_Cell_ID: %d, CC_ID: %d, RU_Port_ID: %d)", duPortId, aCellId, ccId, ruPortId); char id[16]; - g_snprintf(id, 16, "%1x:%2.2x:%1x:%1x", duPortId, aCellId, ccId, ruPortId); + snprintf(id, 16, "%1x:%2.2x:%1x:%1x", duPortId, aCellId, ccId, ruPortId); proto_item *pi = proto_tree_add_string(oran_pcid_tree, hf_oran_c_eAxC_ID, tvb, id_offset, 2, id); proto_item_set_generated(pi); } @@ -646,7 +646,7 @@ static guint32 dissect_bfw_bundle(tvbuff_t *tvb, proto_tree *tree, packet_info * /* Set bundle name */ char bundle_name[32]; if (bundle_number != ORPHAN_BUNDLE_NUMBER) { - g_snprintf(bundle_name, 32, "Bundle %u", bundle_number); + snprintf(bundle_name, 32, "Bundle %u", bundle_number); } else { g_strlcpy(bundle_name, "Orphaned", 32); @@ -1335,7 +1335,7 @@ static int dissect_oran_c(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v offset++; char id[16]; - g_snprintf(id, 16, "%d-%d-%d", frameId, subframeId, slotId); + snprintf(id, 16, "%d-%d-%d", frameId, subframeId, slotId); proto_item *pi = proto_tree_add_string(section_tree, hf_oran_refa, tvb, ref_a_offset, 3, id); proto_item_set_generated(pi); @@ -1492,7 +1492,7 @@ dissect_oran_u(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ offset++; char id[16]; - g_snprintf(id, 16, "%d-%d-%d", frameId, subframeId, slotId); + snprintf(id, 16, "%d-%d-%d", frameId, subframeId, slotId); proto_item *pi = proto_tree_add_string(timing_header_tree, hf_oran_refa, tvb, ref_a_offset, 3, id); proto_item_set_generated(pi); diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c index 60ea3c7047..915dbbce4b 100644 --- a/epan/dissectors/packet-ositp.c +++ b/epan/dissectors/packet-ositp.c @@ -383,20 +383,20 @@ static gchar *print_tsap(tvbuff_t *tvb, int offset, int length) cur=(gchar *)wmem_alloc(wmem_packet_scope(), MAX_TSAP_LEN * 2 + 3); cur[0] = '\0'; if (length <= 0 || length > MAX_TSAP_LEN) - g_snprintf(cur, MAX_TSAP_LEN * 2 + 3, ""); + snprintf(cur, MAX_TSAP_LEN * 2 + 3, ""); else { allprintable = tvb_ascii_isprint(tvb, offset, length); if (!allprintable) { - returned_length = g_snprintf(cur, MAX_TSAP_LEN * 2 + 3, "0x"); + returned_length = snprintf(cur, MAX_TSAP_LEN * 2 + 3, "0x"); idx += MIN(returned_length, MAX_TSAP_LEN * 2 + 3 - 1); } while (length != 0) { if (allprintable) { - returned_length = g_snprintf(&cur[idx], MAX_TSAP_LEN * 2 + 3 - idx, + returned_length = snprintf(&cur[idx], MAX_TSAP_LEN * 2 + 3 - idx, "%c", *tsap ++); idx += MIN(returned_length, MAX_TSAP_LEN * 2 + 3 - idx - 1); } else { - returned_length = g_snprintf(&cur[idx], MAX_TSAP_LEN * 2 + 3 - idx, + returned_length = snprintf(&cur[idx], MAX_TSAP_LEN * 2 + 3 - idx, "%02x", *tsap ++); idx += MIN(returned_length, MAX_TSAP_LEN * 2 + 3 - idx - 1); } diff --git a/epan/dissectors/packet-osmo_trx.c b/epan/dissectors/packet-osmo_trx.c index eb1dfb129f..67c0ffeb48 100644 --- a/epan/dissectors/packet-osmo_trx.c +++ b/epan/dissectors/packet-osmo_trx.c @@ -165,14 +165,14 @@ static const guint16 otrxd_burst_len[] = { /* RSSI is encoded without a negative sign, so we need to show it */ static void format_rssi(gchar *buf, const guint32 rssi) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "-%u%s", rssi, unit_name_string_get_value(rssi, &units_dbm)); + snprintf(buf, ITEM_LABEL_LENGTH, "-%u%s", rssi, unit_name_string_get_value(rssi, &units_dbm)); } /* TSC (Training Sequence Code) set number in 3GPP TS 45.002 starts * from 1, while 'on the wire' it's encoded as X - 1 (starts from 0). */ static void format_tsc_set(gchar *buf, guint32 tsc_set) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u", tsc_set + 1); + snprintf(buf, ITEM_LABEL_LENGTH, "%u", tsc_set + 1); } /* Message direction */ diff --git a/epan/dissectors/packet-ouch.c b/epan/dissectors/packet-ouch.c index 800e63bd70..7c552ab1f8 100644 --- a/epan/dissectors/packet-ouch.c +++ b/epan/dissectors/packet-ouch.c @@ -325,7 +325,7 @@ ouch_tree_add_timestamp( mins = (tmp % 3600) / 60; secs = tmp % 60; - g_snprintf(buf, ITEM_LABEL_LENGTH, + snprintf(buf, ITEM_LABEL_LENGTH, "%u:%02u:%02u.%09u", hours, mins, secs, nsecs); @@ -342,9 +342,9 @@ format_price( guint32 value) { if (value == 0x7fffffff) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%s", "Market"); + snprintf(buf, ITEM_LABEL_LENGTH, "%s", "Market"); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, + snprintf(buf, ITEM_LABEL_LENGTH, "$%u.%04u", value / 10000, value % 10000); } @@ -359,7 +359,7 @@ format_reference_price_type( char *buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, + snprintf(buf, ITEM_LABEL_LENGTH, "%s (%c)", val_to_str_const(value, ouch_reference_price_type_val, @@ -384,15 +384,15 @@ format_tif( switch (value) { case 0: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Immediate Or Cancel (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Immediate Or Cancel (%u)", value); break; case 99998: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Market Hours (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Market Hours (%u)", value); break; case 99999: - g_snprintf(buf, ITEM_LABEL_LENGTH, "System Hours (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "System Hours (%u)", value); break; default: @@ -400,7 +400,7 @@ format_tif( mins = (value % 3600) / 60; secs = value % 60; - g_snprintf(buf, ITEM_LABEL_LENGTH, + snprintf(buf, ITEM_LABEL_LENGTH, "%uh %02um %02us (%u seconds)", hours, mins, secs, value); diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c index 5ef6ad960c..e978d42c18 100644 --- a/epan/dissectors/packet-p_mul.c +++ b/epan/dissectors/packet-p_mul.c @@ -1167,7 +1167,7 @@ static int dissect_p_mul (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v timestamp = tvb_get_ntoh64 (tvb, offset); proto_tree_add_uint64_format_value(p_mul_tree, hf_timestamp_option, tvb, offset, 8, timestamp, - "%" G_GINT64_MODIFIER "d.%d second%s (%" G_GINT64_MODIFIER "u)", + "%" PRId64 ".%d second%s (%" PRIu64 ")", timestamp / 10, (int) timestamp % 10, (timestamp == 10) ? "" : "s", timestamp); offset += 8; diff --git a/epan/dissectors/packet-pcli.c b/epan/dissectors/packet-pcli.c index 8f28dfe056..c629706bba 100644 --- a/epan/dissectors/packet-pcli.c +++ b/epan/dissectors/packet-pcli.c @@ -189,7 +189,7 @@ dissect_pcli20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _ static void pcli_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PCLI payload as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PCLI payload as"); } void diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c index 7eef6aed08..b32930dbf1 100644 --- a/epan/dissectors/packet-pdcp-lte.c +++ b/epan/dissectors/packet-pdcp-lte.c @@ -1121,7 +1121,7 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, va_list ap; va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); /* Add to indicated places */ @@ -2180,7 +2180,7 @@ static int dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, for (l=0, j=0; l<8; l++) { if ((bits << l) & 0x80) { if (bitmap_tree) { - j += g_snprintf(&buff[j], BUFF_SIZE-j, "%6u,", (unsigned)(sn+(8*i)+l)%modulo); + j += snprintf(&buff[j], BUFF_SIZE-j, "%6u,", (unsigned)(sn+(8*i)+l)%modulo); } } else { if (bitmap_tree) { diff --git a/epan/dissectors/packet-pdcp-nr.c b/epan/dissectors/packet-pdcp-nr.c index 164e3f1358..024ca98cd5 100644 --- a/epan/dissectors/packet-pdcp-nr.c +++ b/epan/dissectors/packet-pdcp-nr.c @@ -1130,7 +1130,7 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, va_list ap; va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); /* Add to indicated places */ @@ -2179,7 +2179,7 @@ static int dissect_pdcp_nr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if ((bits << l) & 0x80) { if (bitmap_tree) { /* TODO: better to do mod and show as SN instead? */ - j += g_snprintf(&buff[j], BUFF_SIZE-j, "%10u,", (unsigned)(fmc+(8*i)+l+1)); + j += snprintf(&buff[j], BUFF_SIZE-j, "%10u,", (unsigned)(fmc+(8*i)+l+1)); } } else { if (bitmap_tree) { diff --git a/epan/dissectors/packet-pdu-transport.c b/epan/dissectors/packet-pdu-transport.c index 03c314c354..1300157ef0 100644 --- a/epan/dissectors/packet-pdu-transport.c +++ b/epan/dissectors/packet-pdu-transport.c @@ -268,7 +268,7 @@ dissect_pdu_transport_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v static void pdu_transport_id_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PDU Transport ID 0x%08x as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PDU Transport ID 0x%08x as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_pdu_transport, pinfo->curr_layer_num))); } diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index 15f05965d7..d3d7737da6 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -126,9 +126,9 @@ static void per_check_value(guint32 value, guint32 min_len, guint32 max_len, asn static void per_check_value64(guint64 value, guint64 min_len, guint64 max_len, asn1_ctx_t *actx, proto_item *item, gboolean is_signed) { if ((is_signed == FALSE) && (value > max_len)) { - expert_add_info_format(actx->pinfo, item, &ei_per_size_constraint_value, "Size constraint: value too big: %" G_GINT64_MODIFIER "u (%" G_GINT64_MODIFIER "u .. %" G_GINT64_MODIFIER "u)", value, min_len, max_len); + expert_add_info_format(actx->pinfo, item, &ei_per_size_constraint_value, "Size constraint: value too big: %" PRIu64 " (%" PRIu64 " .. %" PRIu64 ")", value, min_len, max_len); } else if ((is_signed == TRUE) && ((gint64)value > (gint64)max_len)) { - expert_add_info_format(actx->pinfo, item, &ei_per_size_constraint_value, "Size constraint: value too big: %" G_GINT64_MODIFIER "d (%" G_GINT64_MODIFIER "d .. %" G_GINT64_MODIFIER "d)", (gint64)value, (gint64)min_len, (gint64)max_len); + expert_add_info_format(actx->pinfo, item, &ei_per_size_constraint_value, "Size constraint: value too big: %" PRId64 " (%" PRId64 " .. %" PRId64 ")", (gint64)value, (gint64)min_len, (gint64)max_len); } } @@ -319,7 +319,7 @@ dissect_per_length_determinant(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx _ str=(char *)wmem_alloc(wmem_packet_scope(), str_length+1); str_index = 0; - str_length = g_snprintf(str, str_length+1, " "); + str_length = snprintf(str, str_length+1, " "); for(bit=0;bit<((int)(offset&0x07));bit++){ if(bit&&(!(bit%4))){ if (str_index < str_length) str[str_index++] = ' '; @@ -1539,7 +1539,7 @@ DEBUG_ENTRY("dissect_per_constrained_integer_64b"); if (display_internal_per_fields) { proto_tree_add_uint64(tree, hf_per_internal_range, tvb, val_start, val_length, range); proto_tree_add_uint(tree, hf_per_internal_num_bits, tvb, val_start,val_length, num_bits); - proto_tree_add_uint64_format_value(tree, hf_per_internal_value, tvb, val_start, val_length, val, "%s decimal value: %" G_GINT64_MODIFIER "u", str, val); + proto_tree_add_uint64_format_value(tree, hf_per_internal_value, tvb, val_start, val_length, val, "%s decimal value: %" PRIu64, str, val); } } else if(range==256){ /* 10.5.7.2 */ @@ -1579,7 +1579,7 @@ DEBUG_ENTRY("dissect_per_constrained_integer_64b"); num_bytes++; /* lower bound for length determinant is 1 */ if (display_internal_per_fields){ int_item = proto_tree_add_bits_item(tree, hf_per_const_int_len, tvb, offset,n_bits, ENC_BIG_ENDIAN); - proto_item_append_text(int_item,"+1=%u bytes, Range = (%" G_GINT64_MODIFIER "u)",num_bytes, range); + proto_item_append_text(int_item,"+1=%u bytes, Range = (%" PRIu64 ")",num_bytes, range); } offset = offset+n_bits; /* byte aligned */ @@ -2133,7 +2133,7 @@ static tvbuff_t *dissect_per_bit_string_display(tvbuff_t *tvb, guint32 offset, a }else { value = tvb_get_bits64(out_tvb, 0, length, ENC_BIG_ENDIAN); } - proto_item_append_text(actx->created_item, ", %s decimal value %" G_GINT64_MODIFIER "u", + proto_item_append_text(actx->created_item, ", %s decimal value %" PRIu64, decode_bits_in_field(actx->pinfo->pool, 0, length, value, ENC_BIG_ENDIAN), value); if (named_bits) { const guint32 named_bits_bytelen = (num_named_bits + 7) / 8; diff --git a/epan/dissectors/packet-pgm.c b/epan/dissectors/packet-pgm.c index b6bc00976d..83a536cb50 100644 --- a/epan/dissectors/packet-pgm.c +++ b/epan/dissectors/packet-pgm.c @@ -240,23 +240,23 @@ optsstr(wmem_allocator_t *pool, guint8 opts) msg=(char *)wmem_alloc(pool, MAX_STR_LEN); if (opts & PGM_OPT){ - returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "Present"); + returned_length = snprintf(&msg[idx], MAX_STR_LEN-idx, "Present"); idx += MIN(returned_length, MAX_STR_LEN-idx); } if (opts & PGM_OPT_NETSIG){ - returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sNetSig", (!idx)?"":","); + returned_length = snprintf(&msg[idx], MAX_STR_LEN-idx, "%sNetSig", (!idx)?"":","); idx += MIN(returned_length, MAX_STR_LEN-idx); } if (opts & PGM_OPT_VAR_PKTLEN){ - returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sVarLen", (!idx)?"":","); + returned_length = snprintf(&msg[idx], MAX_STR_LEN-idx, "%sVarLen", (!idx)?"":","); idx += MIN(returned_length, MAX_STR_LEN-idx); } if (opts & PGM_OPT_PARITY){ - returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sParity", (!idx)?"":","); + returned_length = snprintf(&msg[idx], MAX_STR_LEN-idx, "%sParity", (!idx)?"":","); idx += MIN(returned_length, MAX_STR_LEN-idx); } if (!idx) { - g_snprintf(&msg[idx], MAX_STR_LEN-idx, "0x%x", opts); + snprintf(&msg[idx], MAX_STR_LEN-idx, "0x%x", opts); } return(msg); } @@ -272,15 +272,15 @@ paritystr(wmem_allocator_t *pool, guint8 parity) msg=(char *)wmem_alloc(pool, MAX_STR_LEN); if (parity & PGM_OPT_PARITY_PRM_PRO){ - returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "Pro-active"); + returned_length = snprintf(&msg[idx], MAX_STR_LEN-idx, "Pro-active"); idx += MIN(returned_length, MAX_STR_LEN-idx); } if (parity & PGM_OPT_PARITY_PRM_OND){ - returned_length = g_snprintf(&msg[idx], MAX_STR_LEN-idx, "%sOn-demand", (!idx)?"":","); + returned_length = snprintf(&msg[idx], MAX_STR_LEN-idx, "%sOn-demand", (!idx)?"":","); idx += MIN(returned_length, MAX_STR_LEN-idx); } if (!idx) { - g_snprintf(&msg[idx], MAX_STR_LEN-idx, "0x%x", parity); + snprintf(&msg[idx], MAX_STR_LEN-idx, "0x%x", parity); } return(msg); } @@ -486,7 +486,7 @@ dissect_pgmopts(ptvcursor_t* cursor, packet_info *pinfo, const char *pktname) */ for (i=0; i < naks; i++) { soffset += MIN(8192-soffset, - g_snprintf(nakbuf+soffset, 8192-soffset, "0x%lx ", + snprintf(nakbuf+soffset, 8192-soffset, "0x%lx ", (unsigned long)g_ntohl(naklist[i]))); if ((++j % 8) == 0) { if (firsttime) { diff --git a/epan/dissectors/packet-protobuf.c b/epan/dissectors/packet-protobuf.c index 3e11c57dfc..3c762ef385 100644 --- a/epan/dissectors/packet-protobuf.c +++ b/epan/dissectors/packet-protobuf.c @@ -551,9 +551,9 @@ protobuf_dissect_field_value(proto_tree *value_tree, tvbuff_t *tvb, guint offset case PROTOBUF_TYPE_SFIXED64: int64_value = (gint64) value; proto_tree_add_int64(value_tree, hf_protobuf_value_int64, tvb, offset, length, int64_value); - proto_item_append_text(ti_field, "%s %" G_GINT64_MODIFIER "d", prepend_text, int64_value); + proto_item_append_text(ti_field, "%s %" PRId64, prepend_text, int64_value); if (is_top_level) { - col_append_fstr(pinfo->cinfo, COL_INFO, "=%" G_GINT64_MODIFIER "d", int64_value); + col_append_fstr(pinfo->cinfo, COL_INFO, "=%" PRId64, int64_value); } if (hf_id_ptr) { proto_tree_add_int64(pbf_tree, *hf_id_ptr, tvb, offset, length, int64_value); @@ -563,9 +563,9 @@ protobuf_dissect_field_value(proto_tree *value_tree, tvbuff_t *tvb, guint offset case PROTOBUF_TYPE_UINT64: case PROTOBUF_TYPE_FIXED64: /* same as UINT64 */ proto_tree_add_uint64(value_tree, hf_protobuf_value_uint64, tvb, offset, length, value); - proto_item_append_text(ti_field, "%s %" G_GINT64_MODIFIER "u", prepend_text, value); + proto_item_append_text(ti_field, "%s %" PRIu64, prepend_text, value); if (is_top_level) { - col_append_fstr(pinfo->cinfo, COL_INFO, "=%" G_GINT64_MODIFIER "u", value); + col_append_fstr(pinfo->cinfo, COL_INFO, "=%" PRIu64, value); } if (hf_id_ptr) { proto_tree_add_uint64(pbf_tree, *hf_id_ptr, tvb, offset, length, value); @@ -718,9 +718,9 @@ protobuf_dissect_field_value(proto_tree *value_tree, tvbuff_t *tvb, guint offset case PROTOBUF_TYPE_SINT64: int64_value = sint64_decode(value); proto_tree_add_int64(value_tree, hf_protobuf_value_int64, tvb, offset, length, int64_value); - proto_item_append_text(ti_field, "%s %" G_GINT64_MODIFIER "d", prepend_text, int64_value); + proto_item_append_text(ti_field, "%s %" PRId64, prepend_text, int64_value); if (is_top_level) { - col_append_fstr(pinfo->cinfo, COL_INFO, "=%" G_GINT64_MODIFIER "d", int64_value); + col_append_fstr(pinfo->cinfo, COL_INFO, "=%" PRId64, int64_value); } if (hf_id_ptr) { proto_tree_add_int64(pbf_tree, *hf_id_ptr, tvb, offset, length, int64_value); @@ -831,7 +831,7 @@ dissect_one_protobuf_field(tvbuff_t *tvb, guint* offset, guint maxlen, packet_in } } - proto_item_append_text(ti_field, "(%" G_GINT64_MODIFIER "u):", field_number); + proto_item_append_text(ti_field, "(%" PRIu64 "):", field_number); /* support filtering with field name */ ti_field_name = proto_tree_add_string(field_tree, hf_protobuf_field_name, tvb, *offset, 1, @@ -1055,7 +1055,7 @@ add_missing_fields_with_default_values(tvbuff_t* tvb, guint offset, packet_info* /* add common tree item for this field */ field_tree = proto_tree_add_subtree_format(message_tree, tvb, offset, 0, ett_protobuf_field, &ti_field, - "Field(%" G_GUINT64_FORMAT "): %s %s", field_number, field_name, "="); + "Field(%" PRIu64 "): %s %s", field_number, field_name, "="); proto_item_set_generated(ti_field); /* support filtering with the name, type or number of the field */ @@ -1063,7 +1063,7 @@ add_missing_fields_with_default_values(tvbuff_t* tvb, guint offset, packet_info* proto_item_set_generated(ti_field_name); ti_field_type = proto_tree_add_int(field_tree, hf_protobuf_field_type, tvb, offset, 0, field_type); proto_item_set_generated(ti_field_type); - ti_field_number = proto_tree_add_uint64_format(field_tree, hf_protobuf_field_number, tvb, offset, 0, field_number << 3, "Field Number: %" G_GUINT64_FORMAT, field_number); + ti_field_number = proto_tree_add_uint64_format(field_tree, hf_protobuf_field_number, tvb, offset, 0, field_number << 3, "Field Number: %" PRIu64, field_number); proto_item_set_generated(ti_field_number); hf_id_ptr = NULL; @@ -1101,7 +1101,7 @@ add_missing_fields_with_default_values(tvbuff_t* tvb, guint offset, packet_info* case PROTOBUF_TYPE_SFIXED64: int64_value = pbw_FieldDescriptor_default_value_int64(field_desc); ti_value = proto_tree_add_int64(field_tree, hf_protobuf_value_int64, tvb, offset, 0, int64_value); - proto_item_append_text(ti_field, " %" G_GINT64_MODIFIER "d", int64_value); + proto_item_append_text(ti_field, " %" PRId64, int64_value); if (hf_id_ptr) { ti_pbf = proto_tree_add_int64(pbf_tree, *hf_id_ptr, tvb, offset, 0, int64_value); } @@ -1121,7 +1121,7 @@ add_missing_fields_with_default_values(tvbuff_t* tvb, guint offset, packet_info* case PROTOBUF_TYPE_FIXED64: uint64_value = pbw_FieldDescriptor_default_value_uint64(field_desc); ti_value = proto_tree_add_uint64(field_tree, hf_protobuf_value_uint64, tvb, offset, 0, uint64_value); - proto_item_append_text(ti_field, " %" G_GINT64_MODIFIER "u", uint64_value); + proto_item_append_text(ti_field, " %" PRIu64, uint64_value); if (hf_id_ptr) { ti_pbf = proto_tree_add_uint64(pbf_tree, *hf_id_ptr, tvb, offset, 0, uint64_value); } diff --git a/epan/dissectors/packet-ptp.c b/epan/dissectors/packet-ptp.c index c32f524187..3f470fc43a 100644 --- a/epan/dissectors/packet-ptp.c +++ b/epan/dissectors/packet-ptp.c @@ -2543,7 +2543,7 @@ dissect_ptp_v2_timeInterval(tvbuff_t *tvb, guint16 *cur_offset, proto_tree *tree ett_ptp_v2_timeInterval, NULL, "%s: %f nanoseconds", name, time_double); proto_tree_add_uint64_format_value(ptptimeInterval_subtree, - hf_ptp_v2_timeInterval_ns, tvb, *cur_offset, 6, time_ns, "Ns: %" G_GINT64_MODIFIER "d nanoseconds", time_ns); + hf_ptp_v2_timeInterval_ns, tvb, *cur_offset, 6, time_ns, "Ns: %" PRId64 " nanoseconds", time_ns); proto_tree_add_double(ptptimeInterval_subtree, hf_ptp_v2_timeInterval_subns, tvb, *cur_offset+6, 2, (time_subns/65536.0)); diff --git a/epan/dissectors/packet-ptpip.c b/epan/dissectors/packet-ptpip.c index e9600114ac..2e273881e1 100644 --- a/epan/dissectors/packet-ptpip.c +++ b/epan/dissectors/packet-ptpip.c @@ -1008,7 +1008,7 @@ static void dissect_ptpIP_protocol_version(tvbuff_t *tvb, proto_tree *tree, guin /* logic to format version */ minorVersion = protoVersion & 0xFFFF; majorVersion = (protoVersion & 0xFFFF0000) >>16; - g_snprintf(version, sizeof(version), "%u.%u", majorVersion, minorVersion); + snprintf(version, sizeof(version), "%u.%u", majorVersion, minorVersion); proto_tree_add_string(tree, hf_ptpIP_version, tvb, *offset, 4, version); *offset += 4; } diff --git a/epan/dissectors/packet-pvfs2.c b/epan/dissectors/packet-pvfs2.c index 9692307c53..c31913f580 100644 --- a/epan/dissectors/packet-pvfs2.c +++ b/epan/dissectors/packet-pvfs2.c @@ -887,7 +887,7 @@ dissect_pvfs_opaque_data(tvbuff_t *tvb, int offset, /* alloc maximum data area */ string_buffer_temp = (char*) wmem_alloc(pinfo->pool, string_buffer_size); /* copy over the data */ - g_snprintf(string_buffer_temp, (gulong)string_buffer_size, + snprintf(string_buffer_temp, (gulong)string_buffer_size, "%s", formatted); /* append */ /* This way, we get the TRUNCATED even @@ -1951,7 +1951,7 @@ dissect_pvfs2_deleattr_request(tvbuff_t *tvb, proto_tree *tree, static void pvfc_fmt_release_num(gchar *result, guint32 release_nr) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d (%d.%d.%d)", + snprintf( result, ITEM_LABEL_LENGTH, "%d (%d.%d.%d)", release_nr, release_nr / 10000, (release_nr % 10000) / 100, diff --git a/epan/dissectors/packet-pw-common.c b/epan/dissectors/packet-pw-common.c index c4817e0c8b..a8a855d29b 100644 --- a/epan/dissectors/packet-pw-common.c +++ b/epan/dissectors/packet-pw-common.c @@ -52,7 +52,7 @@ void pwc_item_append_cw(proto_item* item, const guint32 cw, const gboolean appen { proto_item_append_text(item, ", CW"); } - proto_item_append_text(item, ": 0x%.8" G_GINT32_MODIFIER "x", cw); + proto_item_append_text(item, ": 0x%.8" PRIx32, cw); } return; } diff --git a/epan/dissectors/packet-pw-fr.c b/epan/dissectors/packet-pw-fr.c index 3564d500ce..6efca97015 100644 --- a/epan/dissectors/packet-pw-fr.c +++ b/epan/dissectors/packet-pw-fr.c @@ -174,7 +174,7 @@ dissect_pw_fr( tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* dat proto_item* item; item_headline = proto_tree_add_item(tree, proto_encaps, tvb, 0, 4, ENC_NA); - proto_item_append_text(item_headline, ": 0x%.8" G_GINT32_MODIFIER "x", tvb_get_ntohl(tvb, 0)); + proto_item_append_text(item_headline, ": 0x%.8" PRIx32, tvb_get_ntohl(tvb, 0)); subtree = proto_item_add_subtree(item_headline, ett_encaps); if (packet_quality & PQ_CW_BAD_BITS03) /*display only if value is wrong*/ diff --git a/epan/dissectors/packet-qnet6.c b/epan/dissectors/packet-qnet6.c index 8406f2e482..e9d1b8d918 100644 --- a/epan/dissectors/packet-qnet6.c +++ b/epan/dissectors/packet-qnet6.c @@ -1845,7 +1845,7 @@ display_channel_id(guint32 chid, proto_item * ti) { if (chid & QNX_NTO_GLOBAL_CHANNEL) { - proto_item_append_text(ti, " _NTO_GLOBAL_CHANNEL|%" G_GUINT32_FORMAT, chid & ~QNX_NTO_GLOBAL_CHANNEL); + proto_item_append_text(ti, " _NTO_GLOBAL_CHANNEL|%" PRIu32, chid & ~QNX_NTO_GLOBAL_CHANNEL); } } @@ -1857,7 +1857,7 @@ display_coid(guint32 coid, proto_item * ti) if ((coid & ~QNX_NTO_SIDE_CHANNEL) == 0) proto_item_append_text(ti, " SYSMGR_COID)"); else - proto_item_append_text(ti," (_NTO_SIDE_CHANNEL|%" G_GUINT32_FORMAT ")", coid & ~QNX_NTO_SIDE_CHANNEL); + proto_item_append_text(ti," (_NTO_SIDE_CHANNEL|%" PRIu32 ")", coid & ~QNX_NTO_SIDE_CHANNEL); } } @@ -2902,11 +2902,11 @@ dissect_qnet6_kif_msgsend_msg_notify(tvbuff_t * tvb, packet_info * pinfo _U_, pr for (j = 1, n = 0, m = 0; j < 8; j = j << 1) { if (event & j) - n += g_snprintf(sevent + n, sizeof(sevent) - n, "%s", qnet6_kif_msg_io_notify_event_str[j >> 1]); + n += snprintf(sevent + n, sizeof(sevent) - n, "%s", qnet6_kif_msg_io_notify_event_str[j >> 1]); if (revent & j) - m += g_snprintf(srevent + m, sizeof(srevent) - m, "%s", qnet6_kif_msg_io_notify_event_str[j >> 1]); + m += snprintf(srevent + m, sizeof(srevent) - m, "%s", qnet6_kif_msg_io_notify_event_str[j >> 1]); } - proto_tree_add_string_format_value(stree, hf_qnet6_kif_msg_io_notify_fds, tvb, *poffset, 8, NULL, "fd:%" G_GINT32_FORMAT " " "event:0x%x %s" "revent:0x%x %s", fd, event, sevent, revent, srevent); + proto_tree_add_string_format_value(stree, hf_qnet6_kif_msg_io_notify_fds, tvb, *poffset, 8, NULL, "fd:%" PRId32 " " "event:0x%x %s" "revent:0x%x %s", fd, event, sevent, revent, srevent); *poffset += 8; } left -= nfds * 8; @@ -3462,7 +3462,7 @@ dissect_qnet6_kif_cred(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tre for (; nleft > 0; nleft -= 4) { - proto_item_append_text(ti, " %" G_GUINT32_FORMAT, tvb_get_guint32(tvb, *poffset, encoding)); + proto_item_append_text(ti, " %" PRIu32, tvb_get_guint32(tvb, *poffset, encoding)); *poffset += 4; length += 4; } diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c index 23a03eb3fe..014f327c15 100644 --- a/epan/dissectors/packet-quic.c +++ b/epan/dissectors/packet-quic.c @@ -1323,7 +1323,7 @@ again: // necessary here to tell a retransmission apart from other (normal?) // conditions. See also similar code in packet-tcp.c. #if 0 - proto_tree_add_debug_text(tree, "TODO retransmission expert info frame %d stream_id=%" G_GINT64_MODIFIER "u offset=%d visited=%d reassembly_id=0x%08x", + proto_tree_add_debug_text(tree, "TODO retransmission expert info frame %d stream_id=%" PRIu64 " offset=%d visited=%d reassembly_id=0x%08x", pinfo->num, stream->stream_id, offset, PINFO_FD_VISITED(pinfo), reassembly_id); #endif return; @@ -1736,8 +1736,8 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree proto_tree_add_item_ret_varint(ft_tree, hf_quic_rsts_stream_id, tvb, offset, -1, ENC_VARINT_QUIC, &stream_id, &len_streamid); offset += len_streamid; - proto_item_append_text(ti_ft, " id=%" G_GINT64_MODIFIER "u", stream_id); - col_append_fstr(pinfo->cinfo, COL_INFO, "(%" G_GINT64_MODIFIER "u)", stream_id); + proto_item_append_text(ti_ft, " id=%" PRIu64, stream_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "(%" PRIu64 ")", stream_id); proto_tree_add_item_ret_varint(ft_tree, hf_quic_rsts_application_error_code, tvb, offset, -1, ENC_VARINT_QUIC, &error_code, &len_error_code); offset += len_error_code; @@ -1745,7 +1745,7 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree proto_tree_add_item_ret_varint(ft_tree, hf_quic_rsts_final_size, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_finalsize); offset += len_finalsize; - proto_item_append_text(ti_ft, " Error code: %#" G_GINT64_MODIFIER "x", error_code); + proto_item_append_text(ti_ft, " Error code: %#" PRIx64, error_code); } break; case FT_STOP_SENDING:{ @@ -1758,13 +1758,13 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree proto_tree_add_item_ret_varint(ft_tree, hf_quic_ss_stream_id, tvb, offset, -1, ENC_VARINT_QUIC, &stream_id, &len_streamid); offset += len_streamid; - proto_item_append_text(ti_ft, " id=%" G_GINT64_MODIFIER "u", stream_id); - col_append_fstr(pinfo->cinfo, COL_INFO, "(%" G_GINT64_MODIFIER "u)", stream_id); + proto_item_append_text(ti_ft, " id=%" PRIu64, stream_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "(%" PRIu64 ")", stream_id); proto_tree_add_item_ret_varint(ft_tree, hf_quic_ss_application_error_code, tvb, offset, -1, ENC_VARINT_QUIC, &error_code, &len_error_code); offset += len_error_code; - proto_item_append_text(ti_ft, " Error code: %#" G_GINT64_MODIFIER "x", error_code); + proto_item_append_text(ti_ft, " Error code: %#" PRIx64, error_code); } break; case FT_CRYPTO: { @@ -1833,8 +1833,8 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree proto_tree_add_item_ret_varint(ftid_tree, hf_quic_stream_direction, tvb, offset, -1, ENC_VARINT_QUIC, NULL, NULL); offset += lenvar; - proto_item_append_text(ti_ft, " id=%" G_GINT64_MODIFIER "u", stream_id); - col_append_fstr(pinfo->cinfo, COL_INFO, "(%" G_GINT64_MODIFIER "u)", stream_id); + proto_item_append_text(ti_ft, " id=%" PRIu64, stream_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "(%" PRIu64 ")", stream_id); proto_item_append_text(ti_ft, " fin=%d", !!(frame_type & FTFLAGS_STREAM_FIN)); @@ -1846,7 +1846,7 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree proto_tree_add_item_ret_varint(ft_tree, hf_quic_stream_offset, tvb, offset, -1, ENC_VARINT_QUIC, &stream_offset, &lenvar); offset += lenvar; } - proto_item_append_text(ti_ft, " off=%" G_GINT64_MODIFIER "u", stream_offset); + proto_item_append_text(ti_ft, " off=%" PRIu64, stream_offset); if (frame_type & FTFLAGS_STREAM_LEN) { proto_tree_add_item_ret_varint(ft_tree, hf_quic_stream_length, tvb, offset, -1, ENC_VARINT_QUIC, &length, &lenvar); @@ -1854,7 +1854,7 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree } else { length = tvb_reported_length_remaining(tvb, offset); } - proto_item_append_text(ti_ft, " len=%" G_GINT64_MODIFIER "u dir=%s origin=%s", length, + proto_item_append_text(ti_ft, " len=%" PRIu64 " dir=%s origin=%s", length, val64_to_str_const(!!(stream_id & FTFLAGS_STREAM_DIRECTION), quic_frame_id_direction, "unknown"), val64_to_str_const(!!(stream_id & FTFLAGS_STREAM_INITIATOR), quic_frame_id_initiator, "unknown")); @@ -1896,8 +1896,8 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree proto_tree_add_item_ret_varint(ft_tree, hf_quic_msd_stream_id, tvb, offset, -1, ENC_VARINT_QUIC, &stream_id, &len_streamid); offset += len_streamid; - proto_item_append_text(ti_ft, " id=%" G_GINT64_MODIFIER "u", stream_id); - col_append_fstr(pinfo->cinfo, COL_INFO, "(%" G_GINT64_MODIFIER "u)", stream_id); + proto_item_append_text(ti_ft, " id=%" PRIu64, stream_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "(%" PRIu64 ")", stream_id); proto_tree_add_item_ret_varint(ft_tree, hf_quic_msd_maximum_stream_data, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_maximumstreamdata); offset += len_maximumstreamdata; @@ -1931,8 +1931,8 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree proto_tree_add_item_ret_varint(ft_tree, hf_quic_sdb_stream_id, tvb, offset, -1, ENC_VARINT_QUIC, &stream_id, &len_streamid); offset += len_streamid; - proto_item_append_text(ti_ft, " id=%" G_GINT64_MODIFIER "u", stream_id); - col_append_fstr(pinfo->cinfo, COL_INFO, "(%" G_GINT64_MODIFIER "u)", stream_id); + proto_item_append_text(ti_ft, " id=%" PRIu64, stream_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "(%" PRIu64 ")", stream_id); proto_tree_add_item_ret_varint(ft_tree, hf_quic_sdb_stream_data_limit, tvb, offset, -1, ENC_VARINT_QUIC, NULL, &len_offset); offset += len_offset; @@ -2066,7 +2066,7 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree if (frame_type == FT_CONNECTION_CLOSE_TPT && error_code <= 0x3fff) { proto_item_append_text(ti_ft, " Error code: %s", rval_to_str((guint32)error_code, quic_transport_error_code_vals, "Unknown (%d)")); } else { - proto_item_append_text(ti_ft, " Error code: %#" G_GINT64_MODIFIER "x", error_code); + proto_item_append_text(ti_ft, " Error code: %#" PRIx64, error_code); } if (tls_alert) { proto_item_append_text(ti_ft, " (%s)", tls_alert); @@ -2235,7 +2235,7 @@ dissect_quic_frame_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tree } break; default: - expert_add_info_format(pinfo, ti_ft, &ei_quic_ft_unknown, "Unknown Frame Type %#" G_GINT64_MODIFIER "x", frame_type); + expert_add_info_format(pinfo, ti_ft, &ei_quic_ft_unknown, "Unknown Frame Type %#" PRIx64, frame_type); break; } @@ -3287,7 +3287,7 @@ dissect_quic_long_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tre proto_tree_add_uint64(quic_tree, hf_quic_packet_number, tvb, offset, quic_packet->pkn_len, quic_packet->packet_number); offset += quic_packet->pkn_len; - col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" G_GINT64_MODIFIER "u", quic_packet->packet_number); + col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" PRIu64, quic_packet->packet_number); /* Payload */ #ifdef HAVE_LIBGCRYPT_AEAD @@ -3411,8 +3411,8 @@ dissect_quic_short_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *quic_tr /* Packet Number */ proto_tree_add_uint64(hdr_tree, hf_quic_packet_number, tvb, offset, quic_packet->pkn_len, quic_packet->packet_number); offset += quic_packet->pkn_len; - col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" G_GINT64_MODIFIER "u", quic_packet->packet_number); - proto_item_append_text(pi, " PKN=%" G_GINT64_MODIFIER "u", quic_packet->packet_number); + col_append_fstr(pinfo->cinfo, COL_INFO, ", PKN: %" PRIu64, quic_packet->packet_number); + proto_item_append_text(pi, " PKN=%" PRIu64, quic_packet->packet_number); /* Protected Payload */ #ifdef HAVE_LIBGCRYPT_AEAD diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index 3164b970bd..efa16d2586 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -950,12 +950,12 @@ radius_decrypt_avp(gchar *dest, int dest_len, tvbuff_t *tvb, int offset, int len for (j = 0; j < AUTHENTICATOR_LENGTH; j++) { c = pd[i + j] ^ digest[j]; if (g_ascii_isprint(c)) { - returned_length = g_snprintf(&dest[totlen], dest_len - totlen, + returned_length = snprintf(&dest[totlen], dest_len - totlen, "%c", c); totlen += MIN(returned_length, dest_len - totlen - 1); } else if (c) { - returned_length = g_snprintf(&dest[totlen], dest_len - totlen, + returned_length = snprintf(&dest[totlen], dest_len - totlen, "\\%03o", c); totlen += MIN(returned_length, dest_len - totlen - 1); } @@ -995,7 +995,7 @@ radius_integer(radius_attr_info_t *a, proto_tree *tree, packet_info *pinfo _U_, case 8: { guint64 uintv64 = tvb_get_ntoh64(tvb, offset); proto_tree_add_uint64(tree, a->hf_alt, tvb, offset, len, uintv64); - proto_item_append_text(avp_item, "%" G_GINT64_MODIFIER "u", uintv64); + proto_item_append_text(avp_item, "%" PRIu64, uintv64); return; } default: @@ -1032,7 +1032,7 @@ radius_signed(radius_attr_info_t *a, proto_tree *tree, packet_info *pinfo _U_, t case 8: { guint64 uintv64 = tvb_get_ntoh64(tvb, offset); proto_tree_add_int64(tree, a->hf_alt, tvb, offset, len, uintv64); - proto_item_append_text(avp_item, "%" G_GINT64_MODIFIER "u", uintv64); + proto_item_append_text(avp_item, "%" PRIu64, uintv64); return; } default: diff --git a/epan/dissectors/packet-raknet.c b/epan/dissectors/packet-raknet.c index 1f80984d28..0dacf1da53 100644 --- a/epan/dissectors/packet-raknet.c +++ b/epan/dissectors/packet-raknet.c @@ -289,7 +289,7 @@ raknet_dissect_system_address(proto_tree *tree, int hf, proto_tree_add_item(sub_tree, hf_raknet_port, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_item_set_len(ti, 1 + 4 + 2); - proto_item_append_text(ti, "%s:%" G_GUINT16_FORMAT, addr_str, port); + proto_item_append_text(ti, "%s:%" PRIu16, addr_str, port); break; case 6: addr_str = tvb_ip6_to_str(pinfo->pool, tvb, *offset); @@ -299,7 +299,7 @@ raknet_dissect_system_address(proto_tree *tree, int hf, proto_tree_add_item(sub_tree, hf_raknet_port, tvb, *offset, 2, ENC_BIG_ENDIAN); *offset += 2; proto_item_set_len(ti, 1 + 16 + 2); - proto_item_append_text(ti, "[%s]:%" G_GUINT16_FORMAT, addr_str, port); + proto_item_append_text(ti, "[%s]:%" PRIu16, addr_str, port); break; default: proto_item_set_len(ti, 1); @@ -857,11 +857,11 @@ raknet_dissect_ACK(tvbuff_t *tvb, packet_info *pinfo, if (tvb_get_guint8(tvb, offset)) { /* maxEqualToMin */ min = tvb_get_guint24(tvb, offset + 1, ENC_LITTLE_ENDIAN); - col_append_fstr(pinfo->cinfo, COL_INFO, "#%" G_GUINT32_FORMAT, min); + col_append_fstr(pinfo->cinfo, COL_INFO, "#%" PRIu32, min); ti = proto_tree_add_string_format_value(tree, hf_raknet_packet_number_range, tvb, offset, 1 + 3, "", - "%" G_GUINT32_FORMAT " .. %" G_GUINT32_FORMAT, + "%" PRIu32 " .. %" PRIu32, min, min); sub_tree = proto_item_add_subtree(ti, ett_raknet_packet_number_range); @@ -878,12 +878,12 @@ raknet_dissect_ACK(tvbuff_t *tvb, packet_info *pinfo, max = tvb_get_guint24(tvb, offset + 1 + 3, ENC_LITTLE_ENDIAN); col_append_fstr(pinfo->cinfo, COL_INFO, - "#%" G_GUINT32_FORMAT "..%" G_GUINT32_FORMAT, + "#%" PRIu32 "..%" PRIu32, min, max); ti = proto_tree_add_string_format_value(tree, hf_raknet_packet_number_range, tvb, offset, 1 + 3 + 3, "", - "%" G_GUINT32_FORMAT " .. %" G_GUINT32_FORMAT, min, max); + "%" PRIu32 " .. %" PRIu32, min, max); sub_tree = proto_item_add_subtree(ti, ett_raknet_packet_number_range); proto_tree_add_item(sub_tree, hf_raknet_range_max_equal_to_min, tvb, @@ -946,7 +946,7 @@ raknet_dissect_common_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rak offset, 2, ENC_BIG_ENDIAN, &payload_bits); offset += 2; payload_octets = payload_bits / 8 + (payload_bits % 8 > 0); /* ceil(bits / 8) */ - proto_item_append_text(ti, " bits (%" G_GUINT32_FORMAT " octets)", payload_octets); + proto_item_append_text(ti, " bits (%" PRIu32 " octets)", payload_octets); reliability = (raknet_reliability_t)((msg_flags >> 5) & 0x07); has_split_packet = (msg_flags >> 4) & 0x01 ? TRUE : FALSE; @@ -1030,7 +1030,7 @@ raknet_dissect_common_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rak strbuf = wmem_strbuf_new(pinfo->pool, ""); wmem_strbuf_append_printf(strbuf, - "{Message fragment %" G_GUINT32_FORMAT "/%" G_GUINT32_FORMAT "; Reassembled} ", + "{Message fragment %" PRIu32 "/%" PRIu32 "; Reassembled} ", split_packet_index + 1, split_packet_count); proto_item_append_text(msg_ti, "%s", wmem_strbuf_get_str(strbuf)); @@ -1044,7 +1044,7 @@ raknet_dissect_common_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rak strbuf = wmem_strbuf_new(pinfo->pool, ""); wmem_strbuf_append_printf(strbuf, - "{Message fragment %" G_GUINT32_FORMAT "/%" G_GUINT32_FORMAT "}", + "{Message fragment %" PRIu32 "/%" PRIu32 "}", split_packet_index + 1, split_packet_count); proto_item_append_text(msg_ti, "%s", wmem_strbuf_get_str(strbuf)); @@ -1348,8 +1348,8 @@ raknet_dissect_connected_message(tvbuff_t *tvb, packet_info *pinfo, offset, 3, ENC_LITTLE_ENDIAN, &packet_number); offset += 3; - proto_item_append_text(ti, ", Message #%" G_GUINT32_FORMAT, packet_number); - col_add_fstr(pinfo->cinfo, COL_INFO, "#%" G_GUINT32_FORMAT ": ", packet_number); + proto_item_append_text(ti, ", Message #%" PRIu32, packet_number); + col_add_fstr(pinfo->cinfo, COL_INFO, "#%" PRIu32 ": ", packet_number); col_set_fence(pinfo->cinfo, COL_INFO); /* diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c index b31a17c644..d8ec0ab1ba 100644 --- a/epan/dissectors/packet-reload.c +++ b/epan/dissectors/packet-reload.c @@ -3059,7 +3059,7 @@ static int dissect_diagnosticinfo(tvbuff_t *tvb, proto_tree *tree, guint16 offse proto_tree_add_item(instances_per_kindid_tree, hf_reload_diagnosticinfo_instancesstored_instances, tvb, offset+local_offset+instances_offset+4, 8, ENC_BIG_ENDIAN); instances = tvb_get_ntoh64(tvb, offset+local_offset+instances_offset+4); - proto_item_append_text(ti_instances_per_kindid, ": %s/%" G_GINT64_MODIFIER "d", + proto_item_append_text(ti_instances_per_kindid, ": %s/%" PRId64, ((kind != NULL) && (kind->name != NULL)) ? kind->name : "UNKNOWN KIND", instances); instances_offset += 12; nElements++; diff --git a/epan/dissectors/packet-rfid-pn532.c b/epan/dissectors/packet-rfid-pn532.c index 82699db5c0..df7d59b09a 100644 --- a/epan/dissectors/packet-rfid-pn532.c +++ b/epan/dissectors/packet-rfid-pn532.c @@ -574,16 +574,16 @@ static const value_string pn532_diagnose_baudrate_vals[] = { static void sam_timeout_base(gchar* buf, guint32 value) { if (value == 0x00) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "No timeout control"); + snprintf(buf, ITEM_LABEL_LENGTH, "No timeout control"); } else if (0x01 <= value && value <= 0x13) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 50); + snprintf(buf, ITEM_LABEL_LENGTH, "%u ms", value * 50); } else { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 50 / 1000, value * 50 % 1000); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 50 / 1000, value * 50 % 1000); } } static void replay_delay_base(gchar* buf, guint32 value) { - g_snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 500 / 1000, value * 500 % 1000); + snprintf(buf, ITEM_LABEL_LENGTH, "%u.%03u s", value * 500 / 1000, value * 500 % 1000); } static gint diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c index c576f30bb6..e49530f705 100644 --- a/epan/dissectors/packet-rlc-lte.c +++ b/epan/dissectors/packet-rlc-lte.c @@ -653,7 +653,7 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, proto_item *sub_ti, va_list ap; va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); /* Add to indicated places */ @@ -664,7 +664,7 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, proto_item *sub_ti, } } -/* Version of function above, where no g_vsnprintf() call needed +/* Version of function above, where no vsnprintf() call needed - the info column - the top-level RLC PDU item - another subtree item (if supplied) */ @@ -2380,7 +2380,7 @@ static void dissect_rlc_lte_am_status_pdu(tvbuff_t *tvb, /* We shouldn't NACK the ACK_SN! */ if (nack_sn == ack_sn) { expert_add_info_format(pinfo, nack_ti, &ei_rlc_lte_am_nack_sn_ack_same, - "Status PDU shouldn't ACK and NACK the same sequence number (%" G_GINT64_MODIFIER "u)", + "Status PDU shouldn't ACK and NACK the same sequence number (%" PRIu64 ")", ack_sn); } diff --git a/epan/dissectors/packet-rlc-nr.c b/epan/dissectors/packet-rlc-nr.c index 0a4460885a..e4e8adf16b 100644 --- a/epan/dissectors/packet-rlc-nr.c +++ b/epan/dissectors/packet-rlc-nr.c @@ -338,7 +338,7 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, proto_item *sub_ti, va_list ap; va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); /* Add to indicated places */ @@ -349,7 +349,7 @@ static void write_pdu_label_and_info(proto_item *pdu_ti, proto_item *sub_ti, } } -/* Version of function above, where no g_vsnprintf() call needed +/* Version of function above, where no vsnprintf() call needed - the info column - the top-level RLC PDU item - another subtree item (if supplied) */ @@ -796,7 +796,7 @@ static void dissect_rlc_nr_am_status_pdu(tvbuff_t *tvb, /* We shouldn't NACK the ACK_SN! */ if (nack_sn == ack_sn) { expert_add_info_format(pinfo, nack_ti, &ei_rlc_nr_am_nack_sn_ack_same, - "Status PDU shouldn't ACK and NACK the same sequence number (%" G_GINT64_MODIFIER "u)", + "Status PDU shouldn't ACK and NACK the same sequence number (%" PRIu64 ")", ack_sn); } diff --git a/epan/dissectors/packet-rmt-lct.c b/epan/dissectors/packet-rmt-lct.c index 10fbf3b49f..704c6a3d79 100644 --- a/epan/dissectors/packet-rmt-lct.c +++ b/epan/dissectors/packet-rmt-lct.c @@ -383,7 +383,7 @@ dissect_lct(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) break; } - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TSI: %" G_GINT64_MODIFIER "u", tsi); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TSI: %" PRIu64, tsi); offset += tsi_size; } @@ -431,7 +431,7 @@ dissect_lct(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) } if (toi_size <= 8) - col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TOI: %" G_GINT64_MODIFIER "u", toi); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TOI: %" PRIu64, toi); else col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "TOI: 0x%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, toi_size)); offset += toi_size; diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index 036c5b855e..175670ea60 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -356,7 +356,7 @@ rpcstat_init(struct register_srt* srt, GArray* srt_array) hf_index=rpc_prog_hf(tap_data->program, tap_data->version); hfi=proto_registrar_get_nth(hf_index); - g_snprintf(table_name, sizeof(table_name), "%s Version %u", tap_data->prog, tap_data->version); + snprintf(table_name, sizeof(table_name), "%s Version %u", tap_data->prog, tap_data->version); rpc_srt_table = init_srt_table(table_name, NULL, srt_array, tap_data->num_procedures, NULL, hfi->abbrev, tap_data); for (i = 0; i < rpc_srt_table->num_procs; i++) { diff --git a/epan/dissectors/packet-rsl.c b/epan/dissectors/packet-rsl.c index a249ddb49b..b15f67f5dd 100644 --- a/epan/dissectors/packet-rsl.c +++ b/epan/dissectors/packet-rsl.c @@ -4660,11 +4660,11 @@ req_ref_ra_est_cause_convert(gchar *result, guint32 ra) goto found; } - g_snprintf(result, ITEM_LABEL_LENGTH, "unknown ra %u", ra); + snprintf(result, ITEM_LABEL_LENGTH, "unknown ra %u", ra); return; found: - g_snprintf(result, ITEM_LABEL_LENGTH, "%s", str); + snprintf(result, ITEM_LABEL_LENGTH, "%s", str); } static int diff --git a/epan/dissectors/packet-rtacser.c b/epan/dissectors/packet-rtacser.c index 2a00f10c3e..799b3ec903 100644 --- a/epan/dissectors/packet-rtacser.c +++ b/epan/dissectors/packet-rtacser.c @@ -105,7 +105,7 @@ static const value_string rtacser_eventtype_vals[] = { static void rtacser_ppi_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); } /******************************************************************************************************/ diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c index f8a1f4bf4a..6f4ef5f47a 100644 --- a/epan/dissectors/packet-rtcp.c +++ b/epan/dissectors/packet-rtcp.c @@ -1254,7 +1254,7 @@ dissect_rtcp_psfb_remb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_ proto_tree_add_item( fci_tree, hf_rtcp_psfb_remb_fci_mantissa, tvb, offset, 3, ENC_BIG_ENDIAN ); mantissa = (tvb_get_ntohl( tvb, offset - 1) & 0x0003ffff); bitrate = mantissa << exp; - proto_tree_add_string_format_value( fci_tree, hf_rtcp_psfb_remb_fci_bitrate, tvb, offset, 3, "", "%" G_GINT64_MODIFIER "u", bitrate); + proto_tree_add_string_format_value( fci_tree, hf_rtcp_psfb_remb_fci_bitrate, tvb, offset, 3, "", "%" PRIu64, bitrate); offset += 3; for (indexSsrcs = 0; indexSsrcs < numberSsrcs; indexSsrcs++) @@ -1265,7 +1265,7 @@ dissect_rtcp_psfb_remb( tvbuff_t *tvb, int offset, proto_tree *rtcp_tree, proto_ } if (top_item != NULL) { - proto_item_append_text(top_item, ": REMB: max bitrate=%" G_GINT64_MODIFIER "u", bitrate); + proto_item_append_text(top_item, ": REMB: max bitrate=%" PRIu64, bitrate); } *read_fci = 2 + (numberSsrcs); diff --git a/epan/dissectors/packet-rtls.c b/epan/dissectors/packet-rtls.c index b385028477..f7769c0555 100644 --- a/epan/dissectors/packet-rtls.c +++ b/epan/dissectors/packet-rtls.c @@ -174,7 +174,7 @@ static void rssi_base_custom(gchar *result, guint32 rssi) { /* Convert Hex to decimal and subtract 256 to get the signal value */ - g_snprintf(result, ITEM_LABEL_LENGTH, "%d", rssi - 256); + snprintf(result, ITEM_LABEL_LENGTH, "%d", rssi - 256); } diff --git a/epan/dissectors/packet-rtmpt.c b/epan/dissectors/packet-rtmpt.c index 33abfbf0fb..4b530f6c13 100644 --- a/epan/dissectors/packet-rtmpt.c +++ b/epan/dissectors/packet-rtmpt.c @@ -1097,9 +1097,9 @@ dissect_amf0_value_type(tvbuff_t *tvb, gint offset, proto_tree *tree, gboolean * iInteger64Value = tvb_get_ntoh64(tvb, iValueOffset); proto_tree_add_int64(val_tree, hf_amf_int64, tvb, iValueOffset, 8, iInteger64Value); iValueOffset += 8; - proto_item_append_text(ti," %" G_GINT64_MODIFIER "d", iInteger64Value); + proto_item_append_text(ti," %" PRId64, iInteger64Value); if (parent_ti != NULL) - proto_item_append_text(parent_ti," %" G_GINT64_MODIFIER "d", iInteger64Value); + proto_item_append_text(parent_ti," %" PRId64, iInteger64Value); break; default: /* diff --git a/epan/dissectors/packet-rtnet.c b/epan/dissectors/packet-rtnet.c index 411ac88fbe..d6c6f94c65 100644 --- a/epan/dissectors/packet-rtnet.c +++ b/epan/dissectors/packet-rtnet.c @@ -455,7 +455,7 @@ dissect_tdma_sync(tvbuff_t *tvb, guint offset, proto_tree *tree) { ti = proto_tree_add_item(tree, hf_tdma_sync_xmit_stamp, tvb, offset, 8, ENC_BIG_ENDIAN); timestamp = tvb_get_ntoh64(tvb, offset) - tvb_get_ntoh64(tvb, offset+8); - proto_item_append_text(ti, " (%s%" G_GINT64_MODIFIER "d)", (timestamp > 0) ? "+" : "", timestamp); + proto_item_append_text(ti, " (%s%" PRId64 ")", (timestamp > 0) ? "+" : "", timestamp); offset += 8; proto_tree_add_item(tree, hf_tdma_sync_sched_xmit, tvb, offset, 8, ENC_BIG_ENDIAN); @@ -487,7 +487,7 @@ dissect_tdma_reply_cal(tvbuff_t *tvb, guint offset, proto_tree *tree) { offset += 8; ti = proto_tree_add_item(tree, hf_tdma_rpl_cal_xmit_stamp, tvb, offset, 8, ENC_BIG_ENDIAN); - proto_item_append_text(ti, " (%s%" G_GINT64_MODIFIER "d)", (timestamp > 0) ? "+" : "", timestamp); + proto_item_append_text(ti, " (%s%" PRId64 ")", (timestamp > 0) ? "+" : "", timestamp); } static void diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 66b69f8ac7..d73a7b02e9 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -642,11 +642,11 @@ static void rtp_prompt(packet_info *pinfo _U_, gchar* result) /* Dynamic payload range, don't expose value as it may change within conversation */ if (payload_type > 95) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RTP payload type as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RTP payload type as"); } else { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RTP payload type %d as", payload_type); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "RTP payload type %d as", payload_type); } } diff --git a/epan/dissectors/packet-rtps-virtual-transport.c b/epan/dissectors/packet-rtps-virtual-transport.c index fdd98b8c1f..a640a8ed09 100644 --- a/epan/dissectors/packet-rtps-virtual-transport.c +++ b/epan/dissectors/packet-rtps-virtual-transport.c @@ -554,7 +554,7 @@ static gint dissect_parameter_transport_rtps_type( 0, rtpsvt_ett_monitoring_sn, NULL, - "Monitoring Sequence Number: %" G_GUINT64_FORMAT, + "Monitoring Sequence Number: %" PRIu64, seqNr); /* Add parameter identifier and length */ @@ -587,7 +587,7 @@ static gint dissect_parameter_transport_rtps_type( /* Add summary to packet identifier header */ proto_item_append_text( rtpsvt_tree_identifier, - ", SeqNum: %" G_GUINT64_FORMAT, + ", SeqNum: %" PRIu64, seqNr); } break; @@ -610,18 +610,18 @@ static gint dissect_parameter_transport_rtps_type( tvb, OFFSET_TO_VAL + (gint) (strlen(prefix)), ENC_BIG_ENDIAN); - g_snprintf(addr, sizeof(addr), "%u", pid); + snprintf(addr, sizeof(addr), "%u", pid); } else if (memcmp( &addr_raw.bytes, bytes_zeroed, sizeof(bytes_zeroed)) == 0){ - g_snprintf( + snprintf( addr, sizeof(addr), "%s", tvb_ip_to_str(pinfo->pool, tvb, OFFSET_TO_VAL + sizeof(bytes_zeroed))); } else { - g_snprintf( + snprintf( addr, sizeof(addr), "%s", @@ -763,18 +763,18 @@ static gint dissect_parameter_transport_rtps_type( tvb, OFFSET_TO_VAL + (gint) (strlen(prefix)), ENC_BIG_ENDIAN); - g_snprintf(addr, sizeof(addr), "%u", pid); + snprintf(addr, sizeof(addr), "%u", pid); } else if (memcmp( &addr_raw.bytes, bytes_zeroed, sizeof(bytes_zeroed)) == 0){ - g_snprintf( + snprintf( addr, sizeof(addr), "%s", tvb_ip_to_str(pinfo->pool, tvb, OFFSET_TO_VAL + sizeof(bytes_zeroed))); } else { - g_snprintf( + snprintf( addr, sizeof(addr), "%s", @@ -977,10 +977,10 @@ static gint dissect_rtps_virtual_transport_loss_info_type( if (pinfo->cinfo) { char info[COL_MAX_INFO_LEN] = {'\0'}; - g_snprintf( + snprintf( info, sizeof(info), - "Missing RTPS messages [%" G_GUINT64_FORMAT "-%" G_GUINT64_FORMAT "]", + "Missing RTPS messages [%" PRIu64 "-%" PRIu64 "]", first_lost, last_lost); col_append_str(pinfo->cinfo, COL_INFO, info); diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c index 841843f6e2..bfb0e389ec 100644 --- a/epan/dissectors/packet-rtps.c +++ b/epan/dissectors/packet-rtps.c @@ -2657,7 +2657,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, return offset; } } - //proto_item_append_text(tree, "(Before Switch 0x%016" G_GINT64_MODIFIER "x)", type_id); + //proto_item_append_text(tree, "(Before Switch 0x%016" PRIx64 ")", type_id); switch (member_kind) { case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: { @@ -2734,7 +2734,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); gint64 value = tvb_get_gint64(tvb, offset, encoding); proto_tree_add_int64_format(tree, hf_rtps_dissection_int64, tvb, offset, length, value, - "%s: %"G_GINT64_MODIFIER"d", name, value); + "%s: %"PRId64, name, value); } offset += length; break; @@ -2745,7 +2745,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero); guint64 value = tvb_get_guint64(tvb, offset, encoding); proto_tree_add_uint64_format(tree, hf_rtps_dissection_uint64, tvb, offset, length, value, - "%s: %"G_GINT64_MODIFIER"u", name, value); + "%s: %"PRIu64, name, value); } offset += length; break; @@ -2815,7 +2815,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, if (show && i < num_elements) { /* No need to copy if it will not be shown */ - g_snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i); + snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i); show_current_element = TRUE; } else { if (show_current_element) { @@ -2885,7 +2885,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, gchar temp_buff[MAX_MEMBER_NAME]; if (show && i < num_elements) { /* No need to copy if it will not be shown */ - g_snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i); + snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i); show_current_element = TRUE; } else { if (show_current_element) { @@ -2953,7 +2953,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key)); if (result != NULL) { if (show) { - proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" G_GINT64_MODIFIER "x)", + proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")", value, result->member_type_id); } offset = dissect_user_defined(tree, tvb, offset, encoding, encoding_version, NULL, @@ -2965,7 +2965,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key)); if (result != NULL) { if (show) { - proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" G_GINT64_MODIFIER "x)", + proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")", value, result->member_type_id); } offset = dissect_user_defined(tree, tvb, offset, encoding, encoding_version, NULL, @@ -2974,7 +2974,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, } } else { if (show) { - proto_item_append_text(tree, "(NULL 0x%016" G_GINT64_MODIFIER "x)", type_id); + proto_item_append_text(tree, "(NULL 0x%016" PRIx64 ")", type_id); } } break; @@ -3009,7 +3009,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, } else { if (info->base_type_id > 0) { if (show) { - proto_item_append_text(tree, "(BaseId: 0x%016" G_GINT64_MODIFIER "x)", info->base_type_id); + proto_item_append_text(tree, "(BaseId: 0x%016" PRIx64 ")", info->base_type_id); } offset = dissect_user_defined(aux_tree, tvb, offset, encoding, encoding_version, NULL, info->base_type_id, info->member_name, EXTENSIBILITY_INVALID, @@ -3055,7 +3055,7 @@ static gint dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, gint offset, default:{ /* undefined behavior. this should not happen. the following line helps to debug if it happened */ if (show) { - proto_item_append_text(tree, "(unknown 0x%016" G_GINT64_MODIFIER "x)", member_kind); + proto_item_append_text(tree, "(unknown 0x%016" PRIx64 ")", member_kind); } break; } @@ -3097,13 +3097,13 @@ static gint dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, gint offse key = (info->base_type_id + info->base_type_id * member_id); mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key)); if (mapping) { /* the library knows how to dissect this */ - proto_item_append_text(member, "(base found 0x%016" G_GINT64_MODIFIER "x)", key); + proto_item_append_text(member, "(base found 0x%016" PRIx64 ")", key); dissect_user_defined(tree, tvb, offset, encoding, encoding_version, NULL, mapping->member_type_id, mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show); PROTO_ITEM_SET_HIDDEN(member); return offset + member_length; } else - proto_item_append_text(member, "(base not found 0x%016" G_GINT64_MODIFIER "x from 0x%016" G_GINT64_MODIFIER "x)", + proto_item_append_text(member, "(base not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")", key, info->base_type_id); } } @@ -3111,12 +3111,12 @@ static gint dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, gint offse key = (info->type_id + info->type_id * member_id); mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key)); if (mapping) { /* the library knows how to dissect this */ - proto_item_append_text(member, "(found 0x%016" G_GINT64_MODIFIER "x)", key); + proto_item_append_text(member, "(found 0x%016" PRIx64 ")", key); dissect_user_defined(tree, tvb, offset, encoding, encoding_version, NULL, mapping->member_type_id, mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show); } else - proto_item_append_text(member, "(not found 0x%016" G_GINT64_MODIFIER "x from 0x%016" G_GINT64_MODIFIER "x)", + proto_item_append_text(member, "(not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")", key, info->type_id); PROTO_ITEM_SET_HIDDEN(member); return offset + member_length; @@ -3703,7 +3703,7 @@ static int rtps_util_add_locator_list(proto_tree *tree, packet_info *pinfo, tvbu char temp_buff[20]; for (i = 0; i < num_locators; ++i) { - g_snprintf(temp_buff, 20, "Locator[%d]", i); + snprintf(temp_buff, 20, "Locator[%d]", i); rtps_util_add_locator_t(locator_tree, pinfo, tvb, offset, encoding, temp_buff); offset += 24; @@ -4164,7 +4164,7 @@ static guint64 rtps_util_add_seq_number(proto_tree *tree, guint64 all = (hi << 32) | lo; proto_tree_add_int64_format(tree, hf_rtps_sm_seq_number, tvb, offset, 8, - all, "%s: %" G_GINT64_MODIFIER "u", label, all); + all, "%s: %" PRIu64, label, all); return all; } @@ -4241,7 +4241,7 @@ static void rtps_util_add_timestamp_sec_and_fraction(proto_tree *tree, (void) g_strlcpy(tempBuffer, "0 sec", MAX_TIMESTAMP_SIZE); } else { absolute = (gdouble)sec + (gdouble)frac / ((gdouble)(0x80000000) * 2.0); - g_snprintf(tempBuffer, MAX_TIMESTAMP_SIZE, + snprintf(tempBuffer, MAX_TIMESTAMP_SIZE, "%f sec (%ds + 0x%08x)", absolute, sec, frac); } @@ -4641,7 +4641,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, if (seq_max_len != -1) { /* We're dissecting a sequence of struct, bypass the seq definition */ - g_snprintf(type_name, 40, "%s", struct_name); + snprintf(type_name, 40, "%s", struct_name); break; } @@ -4798,7 +4798,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, if (seq_max_len != -1) { /* We're dissecting a sequence of struct, bypass the seq definition */ - g_snprintf(type_name, 40, "%s", struct_name); + snprintf(type_name, 40, "%s", struct_name); break; } /* Prints it */ @@ -4889,7 +4889,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, LONG_ALIGN(offset); string_length = tvb_get_guint32(tvb, offset, encoding); offset += 4; - g_snprintf(type_name, 40, "%s<%d>", + snprintf(type_name, 40, "%s<%d>", (tk_id == RTI_CDR_TK_STRING) ? "string" : "wstring", string_length); break; @@ -4999,7 +4999,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, if (tk_id == RTI_CDR_TK_VALUE_PARAM) { type_id_name = "valueparam"; } - g_snprintf(type_name, 40, "%s '%s'", type_id_name, value_name); + snprintf(type_name, 40, "%s '%s'", type_id_name, value_name); break; } } /* switch(tk_id) */ @@ -5087,7 +5087,7 @@ static gint rtps_util_add_type_id(proto_tree *tree, longlong_number = tvb_get_guint64(tvb, offset, encoding); proto_tree_add_item(tree, hf_type, tvb, offset, 8, encoding); if (append_info_item) { - proto_item_append_text(append_info_item, "(0x%016" G_GINT64_MODIFIER "x)", longlong_number); + proto_item_append_text(append_info_item, "(0x%016" PRIx64 ")", longlong_number); } offset += 8; } @@ -5350,7 +5350,7 @@ static gint rtps_util_add_type_member(proto_tree *tree, mutable_mapping->member_type_id = member_type_id; mutable_mapping->member_id = member_id; mutable_mapping->key = (mutable_mapping->struct_type_id + mutable_mapping->struct_type_id * mutable_mapping->member_id); - proto_item_append_text(tree, "(Inserted 0x%016" G_GINT64_MODIFIER "x from 0x%016" G_GINT64_MODIFIER "x)", mutable_mapping->key, mutable_mapping->struct_type_id); + proto_item_append_text(tree, "(Inserted 0x%016" PRIx64 " from 0x%016" PRIx64 ")", mutable_mapping->key, mutable_mapping->struct_type_id); wmem_map_insert(mutable_member_mappings, &(mutable_mapping->key), (void *) mutable_mapping); } @@ -5406,7 +5406,7 @@ static gint rtps_util_add_type_union_member(proto_tree *tree, mapping->union_type_id = union_type_id + mapping->discriminator; wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping); - proto_item_append_text(labels, " Added mapping for discriminator (0x%016" G_GINT64_MODIFIER "x) name = %s", + proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s", mapping->union_type_id, mapping->member_name); } if (is_discriminator) { @@ -5419,7 +5419,7 @@ static gint rtps_util_add_type_union_member(proto_tree *tree, mapping->union_type_id = union_type_id + mapping->discriminator; wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping); - proto_item_append_text(labels, " Added mapping for discriminator (0x%016" G_GINT64_MODIFIER "x) name = %s", + proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s", mapping->union_type_id, mapping->member_name); } for (i = 0; i < long_number; i++) { @@ -5439,7 +5439,7 @@ static gint rtps_util_add_type_union_member(proto_tree *tree, mapping->union_type_id = union_type_id + discriminator_case; wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping); - proto_item_append_text(ti, " Added mapping for discriminator (0x%016" G_GINT64_MODIFIER "x) name = %s", + proto_item_append_text(ti, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s", mapping->union_type_id, mapping->member_name); } @@ -5858,7 +5858,7 @@ static int rtps_util_add_bitmap(proto_tree *tree, if (first_seq_number > 0 && num_bits == 0 && show_analysis) { ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0, - 2, "Acknack Analysis: Expecting sample %" G_GINT64_MODIFIER "u", first_seq_number); + 2, "Acknack Analysis: Expecting sample %" PRIu64, first_seq_number); proto_item_set_generated(ti); } @@ -5878,7 +5878,7 @@ static int rtps_util_add_bitmap(proto_tree *tree, wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); if ((data & datamask) == datamask) { proto_item_append_text(ti, - first_nack ? " %" G_GINT64_MODIFIER "u" : ", %" G_GINT64_MODIFIER "u", + first_nack ? " %" PRIu64 : ", %" PRIu64, first_seq_number + idx); first_nack = FALSE; } @@ -5905,7 +5905,7 @@ static int rtps_util_add_bitmap(proto_tree *tree, /* Add analysis of the information */ if (num_bits > 0 && show_analysis) { - proto_item_append_text(ti, "%s in range [%" G_GINT64_MODIFIER "u,%" G_GINT64_MODIFIER "u]", + proto_item_append_text(ti, "%s in range [%" PRIu64 ",%" PRIu64 "]", wmem_strbuf_get_str(analysis_buff), first_seq_number, first_seq_number + num_bits - 1); } @@ -6139,7 +6139,7 @@ static gboolean rtps_util_topic_info_add_column_info_and_try_dissector(proto_tre if (try_dissection_from_type_object && enable_user_data_dissection) { dissection_info * info = (dissection_info *) wmem_map_lookup(dissection_infos, &(type_mapping_object->type_id)); if (info != NULL) { - proto_item_append_text(tree, " (TypeId: 0x%016" G_GINT64_MODIFIER "x)", info->type_id); + proto_item_append_text(tree, " (TypeId: 0x%016" PRIx64 ")", info->type_id); return dissect_user_defined(tree, tvb, offset, encoding, encoding_version, info, info->type_id, info->member_name, EXTENSIBILITY_INVALID, offset, 0 /* flags */, 0 /* member_id */, TRUE); @@ -6911,7 +6911,7 @@ static gboolean dissect_parameter_sequence_rti_dds(proto_tree *rtps_parameter_tr /* Foreach channel... */ for (ch = 0; ch < number_of_channels; ++ch) { - g_snprintf(temp_buff, 20, "Channel[%u]", ch); + snprintf(temp_buff, 20, "Channel[%u]", ch); old_offset = off; channel_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, off, 0, ett_rtps_locator_filter_channel, &ti_channel, "Channel[%u]", ch); @@ -10734,7 +10734,7 @@ static void dissect_RTPS_DATA(tvbuff_t *tvb, packet_info *pinfo, gint offset, gu /* This snippet shows the sequence number in the parent tree */ sequence_number = tvb_get_guint64(tvb, offset, encoding); - proto_item_append_text(guid_tree, ", sn: %" G_GINT64_MODIFIER "u)", + proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")", sequence_number); offset += 8; @@ -10755,7 +10755,7 @@ static void dissect_RTPS_DATA(tvbuff_t *tvb, packet_info *pinfo, gint offset, gu /* This snippet shows the sequence number in the parent tree */ sequence_number = tvb_get_guint64(tvb, offset, encoding); - proto_item_append_text(guid_tree, ", sn: %" G_GINT64_MODIFIER "u)", + proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")", sequence_number); offset += 8; @@ -11044,9 +11044,9 @@ static void dissect_RTPS_DATA_FRAG_kind(tvbuff_t *tvb, packet_info *pinfo, gint /* SerializedData */ { char label[20]; - g_snprintf(label, 9, "fragment"); + snprintf(label, 9, "fragment"); if ((flags & FLAG_RTPS_DATA_FRAG_K) != 0) { - g_snprintf(label, 14, "serializedKey"); + snprintf(label, 14, "serializedKey"); } from_builtin_writer = (((wid & 0xc2) == 0xc2) || ((wid & 0xc3) == 0xc3)) ? TRUE : FALSE; @@ -11084,12 +11084,12 @@ static void dissect_RTPS_DATA_FRAG_kind(tvbuff_t *tvb, packet_info *pinfo, gint } if (new_tvb) { - g_snprintf(label, 19, "reassembled sample"); + snprintf(label, 19, "reassembled sample"); dissect_serialized_data(tree, pinfo, new_tvb, 0, sample_size, label, vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT); break; } else { - g_snprintf(label, 15, "fragment [%d]", frag_index_in_submessage); + snprintf(label, 15, "fragment [%d]", frag_index_in_submessage); dissect_serialized_data(tree, pinfo, tvb, offset + (frag_index_in_submessage * frag_size), this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number); } @@ -11101,7 +11101,7 @@ static void dissect_RTPS_DATA_FRAG_kind(tvbuff_t *tvb, packet_info *pinfo, gint more_fragments = (this_frag_number * frag_size < sample_size); this_frag_size = more_fragments ? frag_size : (sample_size - ((this_frag_number - 1) * frag_size)); fragment_offset = frag_index_in_submessage * frag_size; - g_snprintf(label, 20, "fragment [%d]", frag_index_in_submessage); + snprintf(label, 20, "fragment [%d]", frag_index_in_submessage); dissect_serialized_data(tree, pinfo, tvb, offset + fragment_offset, this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number); frag_index_in_submessage++; @@ -12370,8 +12370,8 @@ static gboolean dissect_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree } /* Used string for the domain participant to show Unknown if the domainId is not known when using TCP*/ if (domain_id != RTPS_UNKNOWN_DOMAIN_ID_VAL) { - g_snprintf(domain_id_str, RTPS_UNKNOWN_DOMAIN_ID_STR_LEN, - "%"G_GINT32_FORMAT, domain_id); + snprintf(domain_id_str, RTPS_UNKNOWN_DOMAIN_ID_STR_LEN, + "%"PRId32, domain_id); } if ((nature == PORT_METATRAFFIC_UNICAST) || (nature == PORT_USERTRAFFIC_UNICAST) || (version < 0x0200)) { diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c index df7d7d8f60..a9e67b6295 100644 --- a/epan/dissectors/packet-rtsp.c +++ b/epan/dissectors/packet-rtsp.c @@ -216,7 +216,7 @@ rtsp_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* e tick_stat_node(st, resp_str, st_node_responses, FALSE); - g_snprintf(str, sizeof(str),"%u %s",i,val_to_str(i,rtsp_status_code_vals, "Unknown (%d)")); + snprintf(str, sizeof(str),"%u %s",i,val_to_str(i,rtsp_status_code_vals, "Unknown (%d)")); tick_stat_node(st, str, resp_grp, FALSE); } else if (v->request_method) { stats_tree_tick_pivot(st,st_node_requests,v->request_method); diff --git a/epan/dissectors/packet-s5066dts.c b/epan/dissectors/packet-s5066dts.c index a8f5ac4c5a..a2f8037ba8 100644 --- a/epan/dissectors/packet-s5066dts.c +++ b/epan/dissectors/packet-s5066dts.c @@ -448,7 +448,7 @@ static guint dissect_s5066dts_eow(tvbuff_t *tvb, packet_info * pinfo, guint off static void s5066dts_address_format( gchar *result, guint32 address_value ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d", + snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d", address_value >> 24, (address_value >> 16) & 0xFF, (address_value >> 8) & 0xFF, diff --git a/epan/dissectors/packet-s7comm.c b/epan/dissectors/packet-s7comm.c index 361cef714b..7ced92650a 100644 --- a/epan/dissectors/packet-s7comm.c +++ b/epan/dissectors/packet-s7comm.c @@ -2535,7 +2535,7 @@ s7comm_get_timestring_from_s7time(tvbuff_t *tvb, guint offset, char *str, gint m mt = gmtime(&t); str[0] = '\0'; if (mt != NULL) { - g_snprintf(str, max, "%s %2d, %d %02d:%02d:%02d.%03d", mon_names[mt->tm_mon], mt->tm_mday, + snprintf(str, max, "%s %2d, %d %02d:%02d:%02d.%03d", mon_names[mt->tm_mon], mt->tm_mday, mt->tm_year + 1900, mt->tm_hour, mt->tm_min, mt->tm_sec, day_msec % 1000); } } @@ -6046,7 +6046,7 @@ s7comm_decode_ud_block_subfunc(tvbuff_t *tvb, offset += 8; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_headername, tvb, offset, 8, ENC_ASCII|ENC_NA); offset += 8; - g_snprintf(str_version, sizeof(str_version), "%d.%d", ((tvb_get_guint8(tvb, offset) & 0xf0) >> 4), tvb_get_guint8(tvb, offset) & 0x0f); + snprintf(str_version, sizeof(str_version), "%d.%d", ((tvb_get_guint8(tvb, offset) & 0xf0) >> 4), tvb_get_guint8(tvb, offset) & 0x0f); proto_tree_add_string(data_tree, hf_s7comm_ud_blockinfo_headerversion, tvb, offset, 1, str_version); offset += 1; proto_tree_add_item(data_tree, hf_s7comm_ud_blockinfo_res_unknown, tvb, offset, 1, ENC_NA); @@ -6310,7 +6310,7 @@ s7comm_decode_ud_data(tvbuff_t *tvb, NULL, /* void *data */ len, /* fragment length - to the end */ more_frags); /* More fragments? */ - g_snprintf(str_fragadd, sizeof(str_fragadd), " id=%d", frag_id); + snprintf(str_fragadd, sizeof(str_fragadd), " id=%d", frag_id); new_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled S7COMM", fd_head, &s7comm_frag_items, NULL, tree); diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c index 05c4270081..8dd85843c2 100644 --- a/epan/dissectors/packet-sccp.c +++ b/epan/dissectors/packet-sccp.c @@ -950,7 +950,7 @@ sccp_reassemble_fragments(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, static void sccp_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect SSN %d as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect SSN %d as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sccp, 0))); } diff --git a/epan/dissectors/packet-scsi-sbc.c b/epan/dissectors/packet-scsi-sbc.c index 71dc0f9345..a0cb7f3eb1 100644 --- a/epan/dissectors/packet-scsi-sbc.c +++ b/epan/dissectors/packet-scsi-sbc.c @@ -312,7 +312,7 @@ dissect_sbc_synchronizecache16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -340,7 +340,7 @@ dissect_sbc_prefetch16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -616,7 +616,7 @@ dissect_sbc_read16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -645,7 +645,7 @@ dissect_sbc_write16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -674,7 +674,7 @@ dissect_sbc_writeatomic16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohs (tvb, offset+11)); } @@ -704,7 +704,7 @@ dissect_sbc_orwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -734,7 +734,7 @@ dissect_sbc_comparenwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -883,7 +883,7 @@ dissect_sbc_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -975,7 +975,7 @@ dissect_sbc_wrverify16 (tvbuff_t *tvb, packet_info *pinfo _U_, }; if (isreq && iscdb) { - col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" G_GINT64_MODIFIER "u, Len: %u)", + col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)", tvb_get_ntoh64 (tvb, offset+1), tvb_get_ntohl (tvb, offset+9)); } @@ -1188,9 +1188,9 @@ dissect_sbc_unmap (tvbuff_t *tvb, packet_info *pinfo _U_, num_blocks = tvb_get_ntohl(tvb, offset+8); if (num_blocks > 1) { - proto_item_append_text (it, "%" G_GINT64_MODIFIER "u-%" G_GINT64_MODIFIER "u ", lba, lba+num_blocks-1); + proto_item_append_text (it, "%" PRIu64 "-%" PRIu64 " ", lba, lba+num_blocks-1); } else { - proto_item_append_text (it, "%" G_GINT64_MODIFIER "u ", lba); + proto_item_append_text (it, "%" PRIu64 " ", lba); } offset += 16; @@ -1469,7 +1469,7 @@ dissect_sbc_serviceactionin16 (tvbuff_t *tvb, packet_info *pinfo _U_, } it = proto_tree_add_item (tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN); - proto_item_append_text (it, " (%" G_GINT64_MODIFIER "u %s)", tot_len, un); + proto_item_append_text (it, " (%" PRIu64 " %s)", tot_len, un); proto_tree_add_item (tree, hf_scsi_sbc_blocksize, tvb, offset+8, 4, ENC_BIG_ENDIAN); @@ -1518,7 +1518,7 @@ dissect_sbc_serviceactionin16 (tvbuff_t *tvb, packet_info *pinfo _U_, /* reserved */ offset += 3; - proto_item_append_text (it, "%" G_GINT64_MODIFIER "u-%" G_GINT64_MODIFIER "u %s", + proto_item_append_text (it, "%" PRIu64 "-%" PRIu64 " %s", lba, lba + num_blocks - 1, val_to_str(type, scsi_provisioning_type_val, "Unknown (0x%02x)") diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 2272605341..16fcf78304 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -670,7 +670,7 @@ sctp_src_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_source_port, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%s%u)", UTF8_RIGHTWARDS_ARROW, port); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer @@ -684,7 +684,7 @@ sctp_dst_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_destination_port, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer @@ -699,7 +699,7 @@ sctp_both_prompt(packet_info *pinfo, gchar *result) guint32 srcport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_source_port, pinfo->curr_layer_num)), destport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_destination_port, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); } static void @@ -708,9 +708,9 @@ sctp_ppi_prompt1(packet_info *pinfo _U_, gchar* result) guint32 ppid = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 0)); if (ppid == LAST_PPID) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (none)"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (none)"); } else { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (%d)", ppid); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (%d)", ppid); } } @@ -720,9 +720,9 @@ sctp_ppi_prompt2(packet_info *pinfo _U_, gchar* result) guint32 ppid = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sctp, 1)); if (ppid == LAST_PPID) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (none)"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (none)"); } else { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (%d)", ppid); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "PPID (%d)", ppid); } } @@ -1077,7 +1077,7 @@ tsn_tree(sctp_tsn_t *t, proto_item *tsn_item, packet_info *pinfo, char ds[64]; if (t->retransmit_count > MAX_RETRANS_TRACKED_PER_TSN) - g_snprintf(ds, sizeof(ds), " (only %d displayed)", MAX_RETRANS_TRACKED_PER_TSN); + snprintf(ds, sizeof(ds), " (only %d displayed)", MAX_RETRANS_TRACKED_PER_TSN); else ds[0] = 0; @@ -3382,7 +3382,7 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, tsn -= ha->first_tsn; } - col_append_fstr(pinfo->cinfo, COL_INFO, "(TSN=%" G_GUINT32_FORMAT ") ", tsn); + col_append_fstr(pinfo->cinfo, COL_INFO, "(TSN=%" PRIu32 ") ", tsn); if (chunk_tree) { if (is_idata) @@ -3742,13 +3742,13 @@ dissect_sack_chunk(packet_info *pinfo, tvbuff_t *chunk_tvb, proto_tree *chunk_tr if(last_end == 0) { /* No GapAck -> only show CumAck */ col_append_fstr(pinfo->cinfo, COL_INFO, - "(Ack=%" G_GUINT32_FORMAT ", Arwnd=%" G_GUINT32_FORMAT ") ", + "(Ack=%" PRIu32 ", Arwnd=%" PRIu32 ") ", cum_tsn_ack, a_rwnd); } else { /* Show CumAck + highest GapAck */ col_append_fstr(pinfo->cinfo, COL_INFO, - "(Ack=%" G_GUINT32_FORMAT "+%" G_GUINT32_FORMAT ", Arwnd=%" G_GUINT32_FORMAT ") ", + "(Ack=%" PRIu32 "+%" PRIu32 ", Arwnd=%" PRIu32 ") ", cum_tsn_ack, last_end, a_rwnd); } diff --git a/epan/dissectors/packet-scylla.c b/epan/dissectors/packet-scylla.c index a01551bc59..298605813e 100644 --- a/epan/dissectors/packet-scylla.c +++ b/epan/dissectors/packet-scylla.c @@ -270,7 +270,7 @@ dissect_scylla_response_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *scyll proto_item *req = proto_tree_add_uint(scylla_tree, hf_scylla_response_request_frame, tvb, 0, 0, req_resp->request_frame_num); proto_item_set_generated(req); - proto_item_append_text(response_ti, " (msg_id=%" G_GINT64_MODIFIER "u, %s)", + proto_item_append_text(response_ti, " (msg_id=%" PRIu64 ", %s)", msg_id, val64_to_str(req_resp->verb_type, packettypenames, "Unknown (0x%02x)")); col_clear(pinfo->cinfo, COL_INFO); @@ -305,7 +305,7 @@ dissect_scylla_msg_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *scylla_tre proto_tree_add_item(scylla_header_tree, hf_scylla_len, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset += 4; - proto_item_append_text(request_ti, " (msg_id=%" G_GINT64_MODIFIER "u)", msg_id); + proto_item_append_text(request_ti, " (msg_id=%" PRIu64 ")", msg_id); switch (verb_type) { case MUTATION: { diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c index 7fdba58baa..c2b42896b4 100644 --- a/epan/dissectors/packet-sdp.c +++ b/epan/dissectors/packet-sdp.c @@ -2816,7 +2816,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) (void) g_strlcat(sdp_pi->summary_str, payload_type_str, 50); } else { char num_pt[10]; - g_snprintf(num_pt, 10, "%u", media_desc->media.pt[j]); + snprintf(num_pt, 10, "%u", media_desc->media.pt[j]); if (strlen(sdp_pi->summary_str)) (void) g_strlcat(sdp_pi->summary_str, " ", 50); (void) g_strlcat(sdp_pi->summary_str, num_pt, 50); diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c index 43edb4dda4..3e0a7a2d4a 100644 --- a/epan/dissectors/packet-selfm.c +++ b/epan/dissectors/packet-selfm.c @@ -1261,7 +1261,7 @@ dissect_fmdata_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int of /* If the stored config_cmd matches the expected one we are looking for, mark that the config data was found */ if (config_cmd == config_cmd_match) { - proto_item_append_text(fmdata_item, ", using frame number %"G_GUINT32_FORMAT" as Configuration Frame", + proto_item_append_text(fmdata_item, ", using frame number %"PRIu32" as Configuration Frame", cfg_data->fnum); config_found = TRUE; } diff --git a/epan/dissectors/packet-sercosiii.c b/epan/dissectors/packet-sercosiii.c index 5d5cba61a9..6c00fc2b9a 100644 --- a/epan/dissectors/packet-sercosiii.c +++ b/epan/dissectors/packet-sercosiii.c @@ -1204,7 +1204,7 @@ dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ static void sercosiii_idn_code_format( gchar *result, guint32 svc_info ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%c-%u-%04d.%d.%d", + snprintf( result, ITEM_LABEL_LENGTH, "%c-%u-%04d.%d.%d", ((0xFFFF & svc_info)>>15)?'P':'S', /* private or sercos IDN */ (svc_info>>12)&7, /* parameter record */ (svc_info&4095), /* IDN */ diff --git a/epan/dissectors/packet-sgsap.c b/epan/dissectors/packet-sgsap.c index b6d8b1887d..44dff963cd 100644 --- a/epan/dissectors/packet-sgsap.c +++ b/epan/dissectors/packet-sgsap.c @@ -109,7 +109,7 @@ de_sgsap_eps_loc_upd_type(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U proto_tree_add_item(tree, hf_sgsap_eps_location_update_type, tvb, offset, 1, ENC_BIG_ENDIAN); if (add_string) { oct = tvb_get_guint8(tvb, curr_offset); - g_snprintf(add_string, string_len, " - %s", val_to_str_const(oct, sgsap_eps_location_update_type_values, "Reserved")); + snprintf(add_string, string_len, " - %s", val_to_str_const(oct, sgsap_eps_location_update_type_values, "Reserved")); } curr_offset++; @@ -147,7 +147,7 @@ de_sgsap_err_msg(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 of get_sgsap_msg_params(oct, &msg_str, &ett_tree, &hf_idx, &msg_fcn_p); if (msg_str) { if (add_string) - g_snprintf(add_string, string_len, " - %s", msg_str); + snprintf(add_string, string_len, " - %s", msg_str); } if (msg_fcn_p){ @@ -227,7 +227,7 @@ de_sgsap_imeisv(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32 proto_tree_add_item_ret_display_string(tree, hf_sgsap_imeisv, tvb, curr_offset, len, ENC_BCD_DIGITS_0_9, pinfo->pool, &imeisv_str); if (add_string) { /* (len<<2)+4 = the maximum number of bytes to produce (including the terminating nul character). */ - g_snprintf(add_string, (len<<2)+4, " - %s", imeisv_str); + snprintf(add_string, (len<<2)+4, " - %s", imeisv_str); } return(len); @@ -376,7 +376,7 @@ de_sgsap_mme_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint } proto_tree_add_string(tree, hf_sgsap_mme_name, tvb, offset, len, fqdn); if (add_string) - g_snprintf(add_string, string_len, " - %s", fqdn); + snprintf(add_string, string_len, " - %s", fqdn); } @@ -447,7 +447,7 @@ de_sgsap_serv_indic(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, gui proto_tree_add_item(tree, hf_sgsap_service_indicator_value, tvb, offset, 1, ENC_BIG_ENDIAN); if (add_string) { oct = tvb_get_guint8(tvb, curr_offset); - g_snprintf(add_string, string_len, " - %s", val_to_str_const(oct, sgsap_service_indicator_values, "Reserved")); + snprintf(add_string, string_len, " - %s", val_to_str_const(oct, sgsap_service_indicator_values, "Reserved")); } curr_offset++; @@ -490,7 +490,7 @@ de_sgsap_sgs_cause(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guin proto_tree_add_item(tree, hf_sgsap_sgs_cause, tvb, offset, 1, ENC_BIG_ENDIAN); if (add_string) { oct = tvb_get_guint8(tvb, curr_offset); - g_snprintf(add_string, string_len, " - %s", val_to_str_ext_const(oct, &sgsap_sgs_cause_values_ext, "Reserved")); + snprintf(add_string, string_len, " - %s", val_to_str_ext_const(oct, &sgsap_sgs_cause_values_ext, "Reserved")); } curr_offset++; @@ -577,7 +577,7 @@ de_sgsap_vlr_name(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint } proto_tree_add_string(tree, hf_sgsap_vlr_name, tvb, offset, len, fqdn); if (add_string) - g_snprintf(add_string, string_len, " - %s", fqdn); + snprintf(add_string, string_len, " - %s", fqdn); } return(len); diff --git a/epan/dissectors/packet-signal-pdu.c b/epan/dissectors/packet-signal-pdu.c index 6938040d0f..027187da43 100644 --- a/epan/dissectors/packet-signal-pdu.c +++ b/epan/dissectors/packet-signal-pdu.c @@ -1588,14 +1588,14 @@ dissect_spdu_payload_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ti = proto_tree_add_uint64(tree, hf_id_effective, tvb, offset, signal_length, value_guint64); } if (value_name != NULL) { - proto_item_append_text(ti, " [raw: 0x%" G_GINT64_MODIFIER "x: %s]", value_guint64, value_name); + proto_item_append_text(ti, " [raw: 0x%" PRIx64 ": %s]", value_guint64, value_name); } else { - proto_item_append_text(ti, " [raw: 0x%" G_GINT64_MODIFIER "x]", value_guint64); + proto_item_append_text(ti, " [raw: 0x%" PRIx64 "]", value_guint64); } subtree = proto_item_add_subtree(ti, ett_spdu_signal); ti = proto_tree_add_uint64(subtree, hf_id_raw, tvb, offset, signal_length, value_guint64); - proto_item_append_text(ti, " (0x%" G_GINT64_MODIFIER "x)", value_guint64); + proto_item_append_text(ti, " (0x%" PRIx64 ")", value_guint64); } break; @@ -1615,14 +1615,14 @@ dissect_spdu_payload_signal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ti = proto_tree_add_int64(tree, hf_id_effective, tvb, offset, signal_length, value_gint64); } if (value_name != NULL) { - proto_item_append_text(ti, " [raw: %" G_GINT64_MODIFIER "x: %s]", value_gint64, value_name); + proto_item_append_text(ti, " [raw: %" PRIx64 ": %s]", value_gint64, value_name); } else { - proto_item_append_text(ti, " [raw: %" G_GINT64_MODIFIER "x]", value_gint64); + proto_item_append_text(ti, " [raw: %" PRIx64 "]", value_gint64); } subtree = proto_item_add_subtree(ti, ett_spdu_signal); ti = proto_tree_add_int64(subtree, hf_id_raw, tvb, offset, signal_length, value_gint64); - proto_item_append_text(ti, " (0x%" G_GINT64_MODIFIER "x)", value_gint64); + proto_item_append_text(ti, " (0x%" PRIx64 ")", value_gint64); } break; diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index d1f6235fa8..d40e1789ad 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -5316,7 +5316,7 @@ guint sip_is_packet_resend(packet_info *pinfo, p_val = wmem_new0(wmem_file_scope(), sip_hash_value); /* Fill in key and value details */ - g_snprintf(p_key->call_id, MAX_CALL_ID_SIZE, "%s", call_id); + snprintf(p_key->call_id, MAX_CALL_ID_SIZE, "%s", call_id); copy_address_wmem(wmem_file_scope(), &(p_key->dest_address), &pinfo->net_dst); copy_address_wmem(wmem_file_scope(), &(p_key->source_address), &pinfo->net_src); p_key->dest_port = pinfo->destport; diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c index 741455bc59..8b5f1b6d64 100644 --- a/epan/dissectors/packet-sll.c +++ b/epan/dissectors/packet-sll.c @@ -107,7 +107,7 @@ static dissector_table_t gre_dissector_table; static void sll_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "SLL protocol type 0x%04x as", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "SLL protocol type 0x%04x as", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_sll, 0))); } diff --git a/epan/dissectors/packet-smb-sidsnooping.c b/epan/dissectors/packet-smb-sidsnooping.c index 1a01b91f7a..6b544043bd 100644 --- a/epan/dissectors/packet-smb-sidsnooping.c +++ b/epan/dissectors/packet-smb-sidsnooping.c @@ -177,7 +177,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co fi_name=(field_info *)gp_names->pdata[num_rids-1]; (void) g_strlcpy(sid_name_str, sid, 256); sid_name_str[len++]='-'; - g_snprintf(sid_name_str+len, 256-len, "%d",fi_rid->value.value.sinteger); + snprintf(sid_name_str+len, 256-len, "%d",fi_rid->value.value.sinteger); add_sid_name_mapping(sid_name_str, fi_name->value.value.string); } return TAP_PACKET_REDRAW; diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index 6cb64e6c91..ec0d89cb84 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -1306,7 +1306,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const if (new_file->is_out_of_memory) { entry->content_type = - g_strdup_printf("%s (%"G_GUINT64_FORMAT"?/%"G_GUINT64_FORMAT") %s [mem!!]", + g_strdup_printf("%s (%"PRIu64"?/%"PRIu64") %s [mem!!]", aux_smb_fid_type_string, new_file->data_gathered, new_file->file_length, @@ -1319,7 +1319,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const } entry->content_type = - g_strdup_printf("%s (%"G_GUINT64_FORMAT"/%"G_GUINT64_FORMAT") %s [%5.2f%%]", + g_strdup_printf("%s (%"PRIu64"/%"PRIu64") %s [%5.2f%%]", aux_smb_fid_type_string, new_file->data_gathered, new_file->file_length, @@ -1341,7 +1341,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const /* Modify the current_entry object_type string */ if (current_file->is_out_of_memory) { current_entry->content_type = - g_strdup_printf("%s (%"G_GUINT64_FORMAT"?/%"G_GUINT64_FORMAT") %s [mem!!]", + g_strdup_printf("%s (%"PRIu64"?/%"PRIu64") %s [mem!!]", aux_smb_fid_type_string, current_file->data_gathered, current_file->file_length, @@ -1349,7 +1349,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const } else { percent = (gfloat) (100*current_file->data_gathered/current_file->file_length); current_entry->content_type = - g_strdup_printf("%s (%"G_GUINT64_FORMAT"/%"G_GUINT64_FORMAT") %s [%5.2f%%]", + g_strdup_printf("%s (%"PRIu64"/%"PRIu64") %s [%5.2f%%]", aux_smb_fid_type_string, current_file->data_gathered, current_file->file_length, @@ -5491,13 +5491,13 @@ smbext20_timeout_msecs_to_str(gint32 timeout) if (timeout <= 0) { buf = (gchar *)wmem_alloc(wmem_packet_scope(), SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1); if (timeout == 0) { - g_snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Return immediately (0)"); + snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Return immediately (0)"); } else if (timeout == -1) { - g_snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Wait indefinitely (-1)"); + snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Wait indefinitely (-1)"); } else if (timeout == -2) { - g_snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Use default timeout (-2)"); + snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Use default timeout (-2)"); } else { - g_snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Unknown reserved value (%d)", timeout); + snprintf(buf, SMBEXT20_TIMEOUT_MSECS_TO_STR_MAXLEN+1, "Unknown reserved value (%d)", timeout); } return buf; } @@ -7073,7 +7073,7 @@ dissect_read_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i ofs = (ofs<<32) | offsetlow; col_append_fstr(pinfo->cinfo, COL_INFO, - ", %u byte%s at offset %" G_GINT64_MODIFIER "u", + ", %u byte%s at offset %" PRIu64, maxcnt, (maxcnt == 1) ? "" : "s", ofs); /* save the offset/len for this transaction */ @@ -7340,7 +7340,7 @@ dissect_write_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ofs = (ofs<<32) | offsetlow; col_append_fstr(pinfo->cinfo, COL_INFO, - ", %u byte%s at offset %" G_GINT64_MODIFIER "u", + ", %u byte%s at offset %" PRIu64, datalen, (datalen == 1) ? "" : "s", ofs); /* save the offset/len for this transaction */ diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index 1122a4cbc8..73adbccfdd 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -4038,7 +4038,7 @@ dissect_smb2_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (!pinfo->fd->visited && si->saved && buf && olb.len) { si->saved->extra_info_type = SMB2_EI_TREENAME; si->saved->extra_info = wmem_alloc(wmem_file_scope(), olb.len+1); - g_snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf); + snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf); } if (buf) { @@ -4368,7 +4368,7 @@ dissect_smb2_find_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i if (!pinfo->fd->visited && si->saved && olb.len) { si->saved->extra_info_type = SMB2_EI_FINDPATTERN; si->saved->extra_info = wmem_alloc(wmem_file_scope(), olb.len+1); - g_snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf); + snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf); } col_append_fstr(pinfo->cinfo, COL_INFO, " %s Pattern: %s", @@ -6530,7 +6530,7 @@ dissect_smb2_write_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item(tree, hf_smb2_file_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; - col_append_fstr(pinfo->cinfo, COL_INFO, " Len:%d Off:%" G_GINT64_MODIFIER "u", length, off); + col_append_fstr(pinfo->cinfo, COL_INFO, " Len:%d Off:%" PRIu64, length, off); /* fid */ offset = dissect_smb2_fid(tvb, pinfo, tree, offset, si, FID_MODE_USE); @@ -7988,7 +7988,7 @@ dissect_smb2_read_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i proto_tree_add_item(tree, hf_smb2_file_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; - col_append_fstr(pinfo->cinfo, COL_INFO, " Len:%d Off:%" G_GINT64_MODIFIER "u", len, off); + col_append_fstr(pinfo->cinfo, COL_INFO, " Len:%d Off:%" PRIu64, len, off); /* fid */ offset = dissect_smb2_fid(tvb, pinfo, tree, offset, si, FID_MODE_USE); @@ -8163,7 +8163,7 @@ add_timestamp_to_info_col(tvbuff_t *tvb, packet_info *pinfo, smb2_info_t *si, gulong len = (gulong)strlen(saved_name); si->saved->extra_info = (gchar *)wmem_alloc(wmem_file_scope(), len + 32 + 1); - g_snprintf((gchar *)si->saved->extra_info, + snprintf((gchar *)si->saved->extra_info, len + 32 + 1 , "%s@%s", (char *)saved_name, abs_time_to_str(pinfo->pool, &ts, ABSOLUTE_TIME_UTC, FALSE)); @@ -8689,8 +8689,8 @@ dissect_smb2_app_instance_version_buffer_request(tvbuff_t *tvb, packet_info *pin proto_tree_add_item_ret_uint64(version_sub_tree, hf_smb2_app_instance_version_low, tvb, offset, 8, ENC_LITTLE_ENDIAN, &version_low); - proto_item_append_text(version_sub_tree, " : %" G_GUINT64_FORMAT ".%" G_GUINT64_FORMAT "", version_high, version_low); - proto_item_append_text(sub_tree, ", version: %" G_GUINT64_FORMAT ".%" G_GUINT64_FORMAT "", version_high, version_low); + proto_item_append_text(version_sub_tree, " : %" PRIu64 ".%" PRIu64, version_high, version_low); + proto_item_append_text(sub_tree, ", version: %" PRIu64 ".%" PRIu64, version_high, version_low); } static void @@ -9125,7 +9125,7 @@ dissect_smb2_create_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (si->saved && f_olb.len < 1024) { si->saved->extra_info_type = SMB2_EI_FILENAME; si->saved->extra_info = (gchar *)wmem_alloc(wmem_file_scope(), f_olb.len+1); - g_snprintf((gchar *)si->saved->extra_info, f_olb.len+1, "%s", fname); + snprintf((gchar *)si->saved->extra_info, f_olb.len+1, "%s", fname); } } diff --git a/epan/dissectors/packet-sml.c b/epan/dissectors/packet-sml.c index 821c1c4bf9..1dded4e872 100644 --- a/epan/dissectors/packet-sml.c +++ b/epan/dissectors/packet-sml.c @@ -2507,7 +2507,7 @@ static int dissect_sml (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static void sml_fmt_length( gchar *result, guint32 length ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d %s", length, plurality(length, "octet", "octets")); + snprintf( result, ITEM_LABEL_LENGTH, "%d %s", length, plurality(length, "octet", "octets")); } void proto_register_sml (void) { diff --git a/epan/dissectors/packet-smp.c b/epan/dissectors/packet-smp.c index 2a556fe236..c50db501b2 100644 --- a/epan/dissectors/packet-smp.c +++ b/epan/dissectors/packet-smp.c @@ -74,7 +74,7 @@ static gboolean reassemble_smp = TRUE; static void smp_prompt(packet_info *pinfo _U_, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Payload as"); } /* Code to actually dissect the packets */ diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c index 19da36072e..2a3047841e 100644 --- a/epan/dissectors/packet-smpp.c +++ b/epan/dissectors/packet-smpp.c @@ -2726,7 +2726,7 @@ dissect_smpp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat static void smpp_fmt_version(gchar *result, guint32 revision) { - g_snprintf(result, ITEM_LABEL_LENGTH, "%u.%u", (guint8)((revision & 0xF0) >> 4), (guint8)(revision & 0x0F)); + snprintf(result, ITEM_LABEL_LENGTH, "%u.%u", (guint8)((revision & 0xF0) >> 4), (guint8)(revision & 0x0F)); } /* Register the protocol with Wireshark */ diff --git a/epan/dissectors/packet-snort-config.c b/epan/dissectors/packet-snort-config.c index 86a4e46276..14391a6bac 100644 --- a/epan/dissectors/packet-snort-config.c +++ b/epan/dissectors/packet-snort-config.c @@ -463,7 +463,7 @@ char *expand_reference(SnortConfig_t *snort_config, char *reference) /* Append prefix and remainder, and return!!!! */ if (prefix_replacement) { - g_snprintf(expanded_reference, 512, "%s%s", prefix_replacement, reference+length+1); + snprintf(expanded_reference, 512, "%s%s", prefix_replacement, reference+length+1); return expanded_reference; } else { diff --git a/epan/dissectors/packet-snort.c b/epan/dissectors/packet-snort.c index 86dd0a3e97..6f3f67fdef 100644 --- a/epan/dissectors/packet-snort.c +++ b/epan/dissectors/packet-snort.c @@ -798,7 +798,7 @@ static void snort_show_alert(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo /* Write 6 figures to position after decimal place in timestamp. Must have managed to parse out fields already, so will definitely be long enough for memcpy() to succeed. */ char digits[7]; - g_snprintf(digits, 7, "%06u", pinfo->abs_ts.nsecs / 1000); + snprintf(digits, 7, "%06u", pinfo->abs_ts.nsecs / 1000); memcpy(alert->raw_alert+18, digits, 6); alert->raw_alert_ts_fixed = TRUE; } diff --git a/epan/dissectors/packet-socketcan.c b/epan/dissectors/packet-socketcan.c index cbb83cedbb..83e528c3e8 100644 --- a/epan/dissectors/packet-socketcan.c +++ b/epan/dissectors/packet-socketcan.c @@ -494,12 +494,12 @@ dissect_socketcan_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 effective_can_id = (can_info.id & CAN_EFF_FLAG) ? can_info.id & CAN_EFF_MASK : can_info.id & CAN_SFF_MASK; char* id_name = (can_info.id & CAN_EFF_FLAG) ? "Ext. ID" : "ID"; - col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %d (0x%" G_GINT32_MODIFIER "x), Length: %d", id_name, effective_can_id, effective_can_id, can_info.len); + col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %d (0x%" PRIx32 "), Length: %d", id_name, effective_can_id, effective_can_id, can_info.len); ti = proto_tree_add_item(tree, (can_packet_type == PACKET_TYPE_CAN_FD) ? proto_canfd : proto_can, tvb, 0, -1, ENC_NA); can_tree = proto_item_add_subtree(ti, (can_packet_type == PACKET_TYPE_CAN_FD) ? ett_can_fd : ett_can); - proto_item_append_text(can_tree, ", %s: %d (0x%" G_GINT32_MODIFIER "x), Length: %d", id_name, effective_can_id, effective_can_id, can_info.len); + proto_item_append_text(can_tree, ", %s: %d (0x%" PRIx32 "), Length: %d", id_name, effective_can_id, effective_can_id, can_info.len); proto_tree_add_bitmask_list(can_tree, tvb, 0, 4, can_flags, encoding); proto_tree_add_item(can_tree, hf_can_len, tvb, CAN_LEN_OFFSET, 1, ENC_NA); diff --git a/epan/dissectors/packet-someip-sd.c b/epan/dissectors/packet-someip-sd.c index e7918c8d55..84134a9bfe 100644 --- a/epan/dissectors/packet-someip-sd.c +++ b/epan/dissectors/packet-someip-sd.c @@ -541,13 +541,13 @@ dissect_someip_sd_pdu_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += 1; if (opt_num1 != 0 && opt_num2 == 0) { - g_snprintf(buf_opt_ref, 32, "%d-%d", opt_index1, opt_index1 + opt_num1 - 1); + snprintf(buf_opt_ref, 32, "%d-%d", opt_index1, opt_index1 + opt_num1 - 1); } else if (opt_num1 == 0 && opt_num2 != 0) { - g_snprintf(buf_opt_ref, 32, "%d-%d", opt_index2, opt_index2 + opt_num2 - 1); + snprintf(buf_opt_ref, 32, "%d-%d", opt_index2, opt_index2 + opt_num2 - 1); } else if (opt_num1 != 0 && opt_num2 != 0) { - g_snprintf(buf_opt_ref, 32, "%d-%d,%d-%d", opt_index1, opt_index1 + opt_num1 - 1, opt_index2, opt_index2 + opt_num2 - 1); + snprintf(buf_opt_ref, 32, "%d-%d,%d-%d", opt_index1, opt_index1 + opt_num1 - 1, opt_index2, opt_index2 + opt_num2 - 1); } else { - g_snprintf(buf_opt_ref, 32, "None"); + snprintf(buf_opt_ref, 32, "None"); } ti = proto_tree_add_string(tree, hf_someip_sd_entry_opts_referenced, tvb, offset - 3, 3, buf_opt_ref); @@ -609,28 +609,28 @@ dissect_someip_sd_pdu_entry(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (ttl > 0) { switch (type) { case SD_ENTRY_FIND_SERVICE: - ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_findservice, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" G_GINT64_MODIFIER "x", uniqueid); + ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_findservice, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" PRIx64, uniqueid); break; case SD_ENTRY_OFFER_SERVICE: - ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_offerservice, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" G_GINT64_MODIFIER "x", uniqueid); + ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_offerservice, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" PRIx64, uniqueid); break; case SD_ENTRY_SUBSCRIBE_EVENTGROUP: - ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_subscribeeventgroup, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" G_GINT64_MODIFIER "x", uniqueid); + ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_subscribeeventgroup, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" PRIx64, uniqueid); break; case SD_ENTRY_SUBSCRIBE_EVENTGROUP_ACK: - ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_subscribeeventgroupack, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" G_GINT64_MODIFIER "x", uniqueid); + ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_subscribeeventgroupack, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" PRIx64, uniqueid); break; } } else { switch (type) { case SD_ENTRY_STOP_OFFER_SERVICE: - ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_stopofferservice, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" G_GINT64_MODIFIER "x", uniqueid); + ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_stopofferservice, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" PRIx64, uniqueid); break; case SD_ENTRY_STOP_SUBSCRIBE_EVENTGROUP: - ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_stopsubscribeeventgroup, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" G_GINT64_MODIFIER "x", uniqueid); + ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_stopsubscribeeventgroup, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" PRIx64, uniqueid); break; case SD_ENTRY_SUBSCRIBE_EVENTGROUP_NACK: - ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_subscribeeventgroupnack, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" G_GINT64_MODIFIER "x", uniqueid); + ti = proto_tree_add_uint64_format_value(tree, hf_someip_sd_entry_type_subscribeeventgroupnack, tvb, offset_orig, SD_ENTRY_LENGTH, uniqueid, "on 0x%012" PRIx64, uniqueid); break; } } diff --git a/epan/dissectors/packet-someip.c b/epan/dissectors/packet-someip.c index 08218d264d..d16264fa42 100644 --- a/epan/dissectors/packet-someip.c +++ b/epan/dissectors/packet-someip.c @@ -2588,10 +2588,10 @@ dissect_someip_payload_base_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr } } else { if (name == NULL) { - ti = proto_tree_add_string_format(tree, hf_payload_str_base, tvb, offset, param_length, base_type->name, "[%s]: %" G_GUINT64_FORMAT " (0x%" G_GINT64_MODIFIER "x)", + ti = proto_tree_add_string_format(tree, hf_payload_str_base, tvb, offset, param_length, base_type->name, "[%s]: %" PRIu64 " (0x%" PRIx64 ")", base_type->name, value, value); } else { - ti = proto_tree_add_string_format(tree, hf_payload_str_base, tvb, offset, param_length, base_type->name, "%s [%s]: %" G_GUINT64_FORMAT " (0x%" G_GINT64_MODIFIER "x)", + ti = proto_tree_add_string_format(tree, hf_payload_str_base, tvb, offset, param_length, base_type->name, "%s [%s]: %" PRIu64 " (0x%" PRIx64 ")", name, base_type->name, value, value); } } diff --git a/epan/dissectors/packet-stanag4607.c b/epan/dissectors/packet-stanag4607.c index 86cec7e05d..aaf36f5ee7 100644 --- a/epan/dissectors/packet-stanag4607.c +++ b/epan/dissectors/packet-stanag4607.c @@ -353,7 +353,7 @@ prt_sa32(gchar *buff, guint32 val) min = floor(60.0 * (x - deg)); sec = 60.0 * (60.0 * (x - deg) - min); /* checkAPI.pl doesn't like the unicode degree symbol, I don't know what to do... */ - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.8f degrees (%.0f %.0f\' %.2f\")", x, deg, min, sec); + snprintf(buff, ITEM_LABEL_LENGTH, "%.8f degrees (%.0f %.0f\' %.2f\")", x, deg, min, sec); } static void @@ -367,7 +367,7 @@ prt_ba32(gchar *buff, guint32 val) min = floor(60.0 * (x - deg)); sec = 60.0 * (60.0 * (x - deg) - min); /* checkAPI.pl doesn't like the unicode degree symbol, I don't know what to do... */ - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.8f degrees (%.0f %.0f\' %.2f\")", x, deg, min, sec); + snprintf(buff, ITEM_LABEL_LENGTH, "%.8f degrees (%.0f %.0f\' %.2f\")", x, deg, min, sec); } static void @@ -376,7 +376,7 @@ prt_sa16(gchar *buff, guint32 val) double x = (double) ((gint32) val); x /= (double) (1<<14); x *= 90.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x); } static void @@ -385,7 +385,7 @@ prt_ba16(gchar *buff, guint32 val) double x = (double) val; x /= (double) (1<<14); x *= 90.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x); } static void @@ -395,9 +395,9 @@ prt_ba16_none(gchar *buff, guint32 val) x /= (double) (1<<14); x *= 90.0; if (val <= 65536) - g_snprintf(buff, ITEM_LABEL_LENGTH, "No Statement"); + snprintf(buff, ITEM_LABEL_LENGTH, "No Statement"); else - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.3f degrees", x); } static void @@ -405,14 +405,14 @@ prt_kilo(gchar *buff, guint32 val) { double x = (double) ((gint32) val); x /= 128.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.2f kilometers", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.2f kilometers", x); } static void prt_meters(gchar *buff, guint32 val) { double x = (double) ((gint32) val); - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.0f meters", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.0f meters", x); } static void @@ -420,7 +420,7 @@ prt_decimeters(gchar *buff, guint32 val) { double x = (double) ((gint32) val); x /= 10.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.1f meters", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.1f meters", x); } static void @@ -428,7 +428,7 @@ prt_centimeters(gchar *buff, guint32 val) { double x = (double) ((gint32) val); x /= 100.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.2f meters", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.2f meters", x); } static void @@ -436,7 +436,7 @@ prt_speed(gchar *buff, guint32 val) { double x = (double) val; x /= 1000.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.3f meters/second", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.3f meters/second", x); } static void @@ -444,7 +444,7 @@ prt_speed_centi(gchar *buff, guint32 val) { double x = (double) ((gint32) val); x /= 100.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.2f meters/second", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.2f meters/second", x); } static void @@ -453,7 +453,7 @@ prt_speed_deci(gchar *buff, guint32 val) /* Usually 8-bit, signed */ double x = (double) ((gint32) val); x /= 10.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.1f meters/second", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.1f meters/second", x); } static void @@ -461,25 +461,25 @@ prt_millisec(gchar *buff, guint32 val) { double x = (double) val; x /= 1000.0; - g_snprintf(buff, ITEM_LABEL_LENGTH, "%.3f seconds", x); + snprintf(buff, ITEM_LABEL_LENGTH, "%.3f seconds", x); } static void prt_none8(gchar *buff, guint32 val) { if (0xff == val) - g_snprintf(buff, ITEM_LABEL_LENGTH, "No Statement"); + snprintf(buff, ITEM_LABEL_LENGTH, "No Statement"); else - g_snprintf(buff, ITEM_LABEL_LENGTH, "%d", val); + snprintf(buff, ITEM_LABEL_LENGTH, "%d", val); } static void prt_none16(gchar *buff, guint32 val) { if (0xffff == val) - g_snprintf(buff, ITEM_LABEL_LENGTH, "No Statement"); + snprintf(buff, ITEM_LABEL_LENGTH, "No Statement"); else - g_snprintf(buff, ITEM_LABEL_LENGTH, "%d", val); + snprintf(buff, ITEM_LABEL_LENGTH, "%d", val); } diff --git a/epan/dissectors/packet-steam-ihs-discovery.c b/epan/dissectors/packet-steam-ihs-discovery.c index 50744340f9..935380bc97 100644 --- a/epan/dissectors/packet-steam-ihs-discovery.c +++ b/epan/dissectors/packet-steam-ihs-discovery.c @@ -233,7 +233,7 @@ protobuf_dissect_unknown_field(protobuf_desc_t *pb, protobuf_tag_t *tag, packet_ value = get_varint64(pb->tvb, pb->offset, pb->bytes_left, &len); if((guint64)value > (guint64)(pb->bytes_left-len)) { ti = proto_tree_add_item(tree, hf_steam_ihs_discovery_unknown_data, pb->tvb, pb->offset+len, pb->bytes_left-len, ENC_NA); - expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_length, "Length-delimited field %"G_GUINT64_FORMAT" has length prefix %"G_GUINT64_FORMAT", but buffer is only %d bytes long.", tag->field_number, (guint64)value, (pb->bytes_left-len)); + expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_length, "Length-delimited field %"PRIu64" has length prefix %"PRIu64", but buffer is only %d bytes long.", tag->field_number, (guint64)value, (pb->bytes_left-len)); len = pb->bytes_left; } else { ti = proto_tree_add_item(tree, hf_steam_ihs_discovery_unknown_data, pb->tvb, pb->offset+len, (gint)value, ENC_NA); @@ -271,11 +271,11 @@ protobuf_verify_wiretype(protobuf_desc_t *pb, protobuf_tag_t *tag, packet_info * len_prefix = get_varint64(pb->tvb, pb->offset, pb->bytes_left, &len); if(len_prefix < 0 || len_prefix > G_MAXINT) { ti = proto_tree_add_item(tree, hf_steam_ihs_discovery_unknown_data, pb->tvb, pb->offset+len, pb->bytes_left-len, ENC_NA); - expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_length, "Length-delimited field %"G_GUINT64_FORMAT" has length prefix %"G_GINT64_FORMAT" outside valid range (0 <= x <= G_MAXINT).", tag->field_number, len_prefix); + expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_length, "Length-delimited field %"PRIu64" has length prefix %"PRId64" outside valid range (0 <= x <= G_MAXINT).", tag->field_number, len_prefix); return pb->bytes_left; } else if(((gint)len_prefix) > (pb->bytes_left-len)) { ti = proto_tree_add_item(tree, hf_steam_ihs_discovery_unknown_data, pb->tvb, pb->offset+len, pb->bytes_left-len, ENC_NA); - expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_length, "Length-delimited field %"G_GUINT64_FORMAT" has length prefix %"G_GINT64_FORMAT", but buffer is only %d bytes long.", tag->field_number, len_prefix, (pb->bytes_left-len)); + expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_length, "Length-delimited field %"PRIu64" has length prefix %"PRId64", but buffer is only %d bytes long.", tag->field_number, len_prefix, (pb->bytes_left-len)); return pb->bytes_left; } } @@ -283,7 +283,7 @@ protobuf_verify_wiretype(protobuf_desc_t *pb, protobuf_tag_t *tag, packet_info * } len = protobuf_dissect_unknown_field(pb, tag, pinfo, tree, &ti); - expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_wiretype, "Expected wiretype %d (%s) for field %"G_GUINT64_FORMAT", but got %d (%s) instead.", expected_wire_type, protobuf_get_wiretype_name(expected_wire_type), tag->field_number, tag->wire_type, protobuf_get_wiretype_name(tag->wire_type)); + expert_add_info_format(pinfo, ti, &ei_steam_ihs_discovery_invalid_wiretype, "Expected wiretype %d (%s) for field %"PRIu64", but got %d (%s) instead.", expected_wire_type, protobuf_get_wiretype_name(expected_wire_type), tag->field_number, tag->wire_type, protobuf_get_wiretype_name(tag->wire_type)); return len; } @@ -440,7 +440,7 @@ steamdiscover_dissect_body_discovery(tvbuff_t *tvb, packet_info *pinfo, proto_tr value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len); proto_tree_add_uint(tree, hf_steam_ihs_discovery_body_discovery_seqnum, pb.tvb, pb.offset, len, (guint32)value); - col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%"G_GUINT32_FORMAT, (guint32)value); + col_append_fstr(pinfo->cinfo, COL_INFO, " Seq=%"PRIu32, (guint32)value); break; case STEAMDISCOVER_FN_DISCOVERY_CLIENTIDS: STEAMDISCOVER_ENSURE_WIRETYPE(PROTOBUF_WIRETYPE_VARINT); @@ -559,14 +559,14 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree value = tvb_get_letoh64(pb2.tvb, pb2.offset); proto_tree_add_uint64(user_tree, hf_steam_ihs_discovery_body_status_user_steamid, pb2.tvb, pb2.offset, len2, (guint64)value); - proto_item_append_text(user_it, ", Steam ID: %"G_GUINT64_FORMAT, (guint64)value); + proto_item_append_text(user_it, ", Steam ID: %"PRIu64, (guint64)value); break; case STEAMDISCOVER_FN_STATUS_USER_AUTHKEYID: if((len2 = protobuf_verify_wiretype(&pb2, &tag, pinfo, user_tree, PROTOBUF_WIRETYPE_VARINT))) break; value = get_varint64(pb2.tvb, pb2.offset, pb2.bytes_left, &len2); proto_tree_add_uint(user_tree, hf_steam_ihs_discovery_body_status_user_authkeyid, pb2.tvb, pb2.offset, len2, (guint32)value); - proto_item_append_text(user_it, ", Auth Key ID: %"G_GUINT32_FORMAT, (guint32)value); + proto_item_append_text(user_it, ", Auth Key ID: %"PRIu32, (guint32)value); break; default: len2 = protobuf_dissect_unknown_field(&pb2, &tag, pinfo, tree, NULL); @@ -702,7 +702,7 @@ steamdiscover_dissect_body_authresponse(tvbuff_t *tvb, packet_info *pinfo, proto value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len); proto_tree_add_uint64(tree, hf_steam_ihs_discovery_body_authresponse_authresult, pb.tvb, pb.offset, len, (guint64)value); - col_add_fstr(pinfo->cinfo, COL_INFO, "%s Result=%"G_GUINT64_FORMAT"(%s)", hf_steam_ihs_discovery_header_msgtype_strings[STEAMDISCOVER_MSGTYPE_DEVICEAUTHORIZATIONRESPONSE].strptr, + col_add_fstr(pinfo->cinfo, COL_INFO, "%s Result=%"PRIu64"(%s)", hf_steam_ihs_discovery_header_msgtype_strings[STEAMDISCOVER_MSGTYPE_DEVICEAUTHORIZATIONRESPONSE].strptr, (guint64)value, val64_to_str_const((guint64)value, hf_steam_ihs_discovery_body_authresponse_authresult_strings, "Unknown")); break; default: @@ -892,14 +892,14 @@ steamdiscover_dissect_body_streamingresponse(tvbuff_t *tvb, packet_info *pinfo, value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len); proto_tree_add_uint64(tree, hf_steam_ihs_discovery_body_streamingresponse_result, pb.tvb, pb.offset, len, (guint64)value); - col_append_fstr(pinfo->cinfo, COL_INFO, " Result=%"G_GUINT64_FORMAT"(%s)", (guint64)value, val64_to_str_const((guint64)value, hf_steam_ihs_discovery_body_streamingresponse_result_strings, "Unknown")); + col_append_fstr(pinfo->cinfo, COL_INFO, " Result=%"PRIu64"(%s)", (guint64)value, val64_to_str_const((guint64)value, hf_steam_ihs_discovery_body_streamingresponse_result_strings, "Unknown")); break; case STEAMDISCOVER_FN_STREAMINGRESPONSE_PORT: STEAMDISCOVER_ENSURE_WIRETYPE(PROTOBUF_WIRETYPE_VARINT); value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len); proto_tree_add_uint(tree, hf_steam_ihs_discovery_body_streamingresponse_port, pb.tvb, pb.offset, len, (guint32)value); - col_append_fstr(pinfo->cinfo, COL_INFO, " Port=%"G_GUINT32_FORMAT, (guint32)value); + col_append_fstr(pinfo->cinfo, COL_INFO, " Port=%"PRIu32, (guint32)value); break; case STEAMDISCOVER_FN_STREAMINGRESPONSE_ENCRYPTEDSESSIONKEY: STEAMDISCOVER_ENSURE_WIRETYPE(PROTOBUF_WIRETYPE_LENGTHDELIMITED); diff --git a/epan/dissectors/packet-stt.c b/epan/dissectors/packet-stt.c index 9c62aba15e..eaf36bbc3e 100644 --- a/epan/dissectors/packet-stt.c +++ b/epan/dissectors/packet-stt.c @@ -423,7 +423,7 @@ dissect_stt_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *stt_tree, /* Context ID */ context_id = tvb_get_ntoh64(tvb, offset); proto_tree_add_item(stt_tree, hf_stt_context_id, tvb, offset, 8, ENC_BIG_ENDIAN); - proto_item_append_text(stt_item, ", Context ID: 0x%" G_GINT64_MODIFIER "x", + proto_item_append_text(stt_item, ", Context ID: 0x%" PRIx64, context_id); offset += 8; diff --git a/epan/dissectors/packet-synphasor.c b/epan/dissectors/packet-synphasor.c index 7db93cc46e..4773e470c5 100644 --- a/epan/dissectors/packet-synphasor.c +++ b/epan/dissectors/packet-synphasor.c @@ -1129,7 +1129,7 @@ static gint dissect_ANALOG(tvbuff_t *tvb, proto_tree *tree, config_block *block, * so I just use gint16; the scaling of the conversion factor * is also "user defined", so I just write it after the analog value */ gint16 tmp = tvb_get_ntohs(tvb, offset); offset += 2; - proto_item_append_text(temp_item, ", %" G_GINT16_FORMAT " (conversion factor: %#06x)", + proto_item_append_text(temp_item, ", %" PRId16 " (conversion factor: %#06x)", tmp, ai->conv); } } @@ -1286,7 +1286,7 @@ static gint dissect_ANUNIT(tvbuff_t *tvb, proto_tree *tree, gint offset, gint cn if ( tmp & 0x00800000) /* sign bit set */ tmp |= 0xFF000000; - proto_item_append_text(temp_item, ", value: %" G_GINT32_FORMAT, tmp); + proto_item_append_text(temp_item, ", value: %" PRId32, tmp); offset += 4; } @@ -1442,7 +1442,7 @@ static int dissect_config_frame(tvbuff_t *tvb, proto_item *config_item) proto_tree_add_item(config_tree, hf_conf_numpmu, tvb, offset, 2, ENC_BIG_ENDIAN); /* add number of included PMUs to the text in the list view */ num_pmu = tvb_get_ntohs(tvb, offset); offset += 2; - proto_item_append_text(config_item, ", %"G_GUINT16_FORMAT" PMU(s) included", num_pmu); + proto_item_append_text(config_item, ", %"PRIu16" PMU(s) included", num_pmu); /* dissect the repeating PMU blocks */ for (j = 0; j < num_pmu; j++) { @@ -1541,7 +1541,7 @@ static int dissect_config_3_frame(tvbuff_t *tvb, proto_item *config_item) num_pmu = tvb_get_ntohs(tvb, offset); offset += 2; - proto_item_append_text(config_item, ", %"G_GUINT16_FORMAT" PMU(s) included", num_pmu); + proto_item_append_text(config_item, ", %"PRIu16" PMU(s) included", num_pmu); /* dissect the repeating PMU blocks */ for (j = 0; j < num_pmu; j++) { diff --git a/epan/dissectors/packet-sysdig-event.c b/epan/dissectors/packet-sysdig-event.c index 3259ab14ed..81652f4838 100644 --- a/epan/dissectors/packet-sysdig-event.c +++ b/epan/dissectors/packet-sysdig-event.c @@ -2333,7 +2333,7 @@ dissect_sysdig_event(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, col_append_str(pinfo->cinfo, COL_INFO, format_param_str(tvb, param_offset, param_len)); break; case FT_UINT64: - col_append_fstr(pinfo->cinfo, COL_INFO, "%" G_GUINT64_FORMAT, tvb_get_guint64(tvb, param_offset, encoding)); + col_append_fstr(pinfo->cinfo, COL_INFO, "%" PRIu64, tvb_get_guint64(tvb, param_offset, encoding)); default: break; } diff --git a/epan/dissectors/packet-t30.c b/epan/dissectors/packet-t30.c index be47ffe651..4393816bc2 100644 --- a/epan/dissectors/packet-t30.c +++ b/epan/dissectors/packet-t30.c @@ -526,7 +526,7 @@ dissect_t30_numbers(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, prot col_append_fstr(pinfo->cinfo, COL_INFO, " - Number:%s", str_num ); if (t38) - g_snprintf(t38->desc, MAX_T38_DESC, "Num: %s", str_num); + snprintf(t38->desc, MAX_T38_DESC, "Num: %s", str_num); } else { proto_tree_add_expert_format(tree, pinfo, &ei_t30_bad_length, tvb, offset, -1, @@ -555,7 +555,7 @@ dissect_t30_facsimile_coded_data(tvbuff_t *tvb, int offset, packet_info *pinfo, col_append_fstr(pinfo->cinfo, COL_INFO, " - Frame num:%d", reverse_byte(octet)); if (t38) - g_snprintf(t38->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet)); + snprintf(t38->desc, MAX_T38_DESC, "Frm num: %d", reverse_byte(octet)); proto_tree_add_item(tree, hf_t30_t4_data, tvb, offset, len-1, ENC_NA); } @@ -610,7 +610,7 @@ dissect_t30_partial_page_signal(tvbuff_t *tvb, int offset, packet_info *pinfo, i col_append_fstr(pinfo->cinfo, COL_INFO, " - PC:%d BC:%d FC:%d", page_count, block_count, frame_count); if (t38) - g_snprintf(t38->desc, MAX_T38_DESC, + snprintf(t38->desc, MAX_T38_DESC, "PC:%d BC:%d FC:%d", page_count, block_count, frame_count); } @@ -641,7 +641,7 @@ dissect_t30_partial_page_request(tvbuff_t *tvb, int offset, packet_info *pinfo, if (octet & bit) { ++frame_count; DISSECTOR_ASSERT((buf_top-buf) < BUF_SIZE); - buf_top += g_snprintf(buf_top, BUF_SIZE - (gulong)(buf_top - buf), "%u, ", frame); + buf_top += snprintf(buf_top, BUF_SIZE - (gulong)(buf_top - buf), "%u, ", frame); } bit >>= 1; ++frame; @@ -692,7 +692,7 @@ dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, prot val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_vals_ext, "")); if (t38) - g_snprintf(t38->desc, MAX_T38_DESC, + snprintf(t38->desc, MAX_T38_DESC, "DSR:%s", val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_vals_ext, "")); } @@ -703,7 +703,7 @@ dissect_t30_dis_dtc(tvbuff_t *tvb, int offset, packet_info *pinfo, int len, prot val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_dcs_vals_ext, "")); if (t38) - g_snprintf(t38->desc, MAX_T38_DESC, + snprintf(t38->desc, MAX_T38_DESC, "DSR:%s", val_to_str_ext_const((octet&0x3C) >> 2, &t30_data_signalling_rate_dcs_vals_ext, "")); } diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index 613ac5c03c..8456b7bbf0 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -753,7 +753,7 @@ tcp_src_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_tcp_srcport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW); } static gpointer @@ -767,7 +767,7 @@ tcp_dst_prompt(packet_info *pinfo, gchar *result) { guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_tcp_dstport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer @@ -781,7 +781,7 @@ tcp_both_prompt(packet_info *pinfo, gchar *result) { guint32 srcport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_tcp_srcport, pinfo->curr_layer_num)), destport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_tcp_dstport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); } static const char* tcp_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter) @@ -1387,22 +1387,22 @@ static void conversation_completeness_fill(gchar *buf, guint32 value) { switch(value) { case TCP_COMPLETENESS_SYNSENT: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, SYN_SENT (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, SYN_SENT (%u)", value); break; case (TCP_COMPLETENESS_SYNSENT| TCP_COMPLETENESS_SYNACK): - g_snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, CLIENT_ESTABLISHED (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, CLIENT_ESTABLISHED (%u)", value); break; case (TCP_COMPLETENESS_SYNSENT| TCP_COMPLETENESS_SYNACK| TCP_COMPLETENESS_ACK): - g_snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, ESTABLISHED (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, ESTABLISHED (%u)", value); break; case (TCP_COMPLETENESS_SYNSENT| TCP_COMPLETENESS_SYNACK| TCP_COMPLETENESS_ACK| TCP_COMPLETENESS_DATA): - g_snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, DATA (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete, DATA (%u)", value); break; case (TCP_COMPLETENESS_SYNSENT| TCP_COMPLETENESS_SYNACK| @@ -1420,7 +1420,7 @@ static void conversation_completeness_fill(gchar *buf, guint32 value) TCP_COMPLETENESS_DATA| TCP_COMPLETENESS_FIN| TCP_COMPLETENESS_RST): - g_snprintf(buf, ITEM_LABEL_LENGTH, "Complete, WITH_DATA (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Complete, WITH_DATA (%u)", value); break; case (TCP_COMPLETENESS_SYNSENT| TCP_COMPLETENESS_SYNACK| @@ -1435,10 +1435,10 @@ static void conversation_completeness_fill(gchar *buf, guint32 value) TCP_COMPLETENESS_ACK| TCP_COMPLETENESS_FIN| TCP_COMPLETENESS_RST): - g_snprintf(buf, ITEM_LABEL_LENGTH, "Complete, NO_DATA (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Complete, NO_DATA (%u)", value); break; default: - g_snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete (%u)", value); + snprintf(buf, ITEM_LABEL_LENGTH, "Incomplete (%u)", value); break; } } @@ -5039,7 +5039,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* if (mph->mh_dss_flags & MPTCP_DSS_FLAG_DATA_ACK_8BYTES) { mph->mh_dss_rawack = tvb_get_ntoh64(tvb,offset); - proto_tree_add_uint64_format_value(mptcp_tree, hf_tcp_option_mptcp_data_ack_raw, tvb, offset, 8, mph->mh_dss_rawack, "%" G_GINT64_MODIFIER "u (64bits)", mph->mh_dss_rawack); + proto_tree_add_uint64_format_value(mptcp_tree, hf_tcp_option_mptcp_data_ack_raw, tvb, offset, 8, mph->mh_dss_rawack, "%" PRIu64 " (64bits)", mph->mh_dss_rawack); offset += 8; } /* 32bits ack */ @@ -5072,7 +5072,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* if (mph->mh_dss_flags & MPTCP_DSS_FLAG_DSN_8BYTES) { dsn = tvb_get_ntoh64(tvb,offset); - proto_tree_add_uint64_format_value(mptcp_tree, hf_tcp_option_mptcp_data_seq_no_raw, tvb, offset, 8, dsn, "%" G_GINT64_MODIFIER "u (64bits version)", dsn); + proto_tree_add_uint64_format_value(mptcp_tree, hf_tcp_option_mptcp_data_seq_no_raw, tvb, offset, 8, dsn, "%" PRIu64 " (64bits version)", dsn); /* if we have the opportunity to complete the 32 Most Significant Bits of the * @@ -5084,7 +5084,7 @@ dissect_tcpopt_mptcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* offset += 8; } else { dsn = tvb_get_ntohl(tvb,offset); - proto_tree_add_uint64_format_value(mptcp_tree, hf_tcp_option_mptcp_data_seq_no_raw, tvb, offset, 4, dsn, "%" G_GINT64_MODIFIER "u (32bits version)", dsn); + proto_tree_add_uint64_format_value(mptcp_tree, hf_tcp_option_mptcp_data_seq_no_raw, tvb, offset, 4, dsn, "%" PRIu64 " (32bits version)", dsn); offset += 4; } mph->mh_dss_rawdsn = dsn; diff --git a/epan/dissectors/packet-tcpcl.c b/epan/dissectors/packet-tcpcl.c index 13f70ac534..c852f2159f 100644 --- a/epan/dissectors/packet-tcpcl.c +++ b/epan/dissectors/packet-tcpcl.c @@ -1486,7 +1486,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, msgtype = tvb_get_guint8(tvb, offset); proto_tree_add_uint(tree_msg, hf_tcpclv4_mhdr_type, tvb, offset, 1, msgtype); offset += 1; - msgtype_name = val_to_str(msgtype, v4_message_type_vals, "type 0x%02" G_GINT32_MODIFIER "x"); + msgtype_name = val_to_str(msgtype, v4_message_type_vals, "type 0x%02" PRIx32); wmem_strbuf_t *suffix_text = wmem_strbuf_new(wmem_packet_scope(), NULL); switch(msgtype) { @@ -1539,7 +1539,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dissector_handle_t subdis = dissector_get_uint_handle(xfer_ext_dissectors, extitem_type); const char *subname = dissector_handle_get_dissector_name(subdis); if (subdis) { - proto_item_set_text(item_type, "Item Type: %s (0x%04" G_GINT16_MODIFIER "x)", subname, extitem_type); + proto_item_set_text(item_type, "Item Type: %s (0x%04" PRIx16 ")", subname, extitem_type); } guint16 extitem_len = tvb_get_guint16(tvb, offset + extlist_offset + extitem_offset, ENC_BIG_ENDIAN); @@ -1566,7 +1566,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item_append_text(item_ext, ": %s", subname); } else { - proto_item_append_text(item_ext, ": Type 0x%04" G_GINT16_MODIFIER "x", extitem_type); + proto_item_append_text(item_ext, ": Type 0x%04" PRIx16, extitem_type); } if (is_critical) { proto_item_append_text(item_ext, ", CRITICAL"); @@ -1663,7 +1663,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, dissector_handle_t subdis = dissector_get_uint_handle(xfer_ext_dissectors, extitem_type); const char *subname = dissector_handle_get_dissector_name(subdis); if (subdis) { - proto_item_set_text(item_type, "Item Type: %s (0x%04" G_GINT16_MODIFIER "x)", subname, extitem_type); + proto_item_set_text(item_type, "Item Type: %s (0x%04" PRIx16 ")", subname, extitem_type); } guint16 extitem_len = tvb_get_guint16(tvb, offset + extlist_offset + extitem_offset, ENC_BIG_ENDIAN); @@ -1693,7 +1693,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item_append_text(item_ext, ": %s", subname); } else { - proto_item_append_text(item_ext, ": Type 0x%04" G_GINT16_MODIFIER "x", extitem_type); + proto_item_append_text(item_ext, ": Type 0x%04" PRIx16, extitem_type); } if (is_critical) { proto_item_append_text(item_ext, ", CRITICAL"); @@ -1718,7 +1718,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += data_len_clamp; payload_len = data_len_clamp; - wmem_strbuf_append_printf(suffix_text, ", Xfer ID: %" G_GINT64_MODIFIER "i", xfer_id); + wmem_strbuf_append_printf(suffix_text, ", Xfer ID: %" PRIi64, xfer_id); if (flags) { wmem_strbuf_append(suffix_text, ", Flags: "); @@ -1773,7 +1773,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_uint64(tree_msg, hf_tcpclv4_xfer_ack_ack_len, tvb, offset, 8, ack_len); offset += 8; - wmem_strbuf_append_printf(suffix_text, ", Xfer ID: %" G_GINT64_MODIFIER "i", xfer_id); + wmem_strbuf_append_printf(suffix_text, ", Xfer ID: %" PRIi64, xfer_id); if (flags) { wmem_strbuf_append(suffix_text, ", Flags: "); @@ -1805,7 +1805,7 @@ dissect_v4_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_uint64(tree_msg, hf_tcpclv4_xfer_id, tvb, offset, 8, xfer_id); offset += 8; - wmem_strbuf_append_printf(suffix_text, ", Xfer ID: %" G_GINT64_MODIFIER "i", xfer_id); + wmem_strbuf_append_printf(suffix_text, ", Xfer ID: %" PRIi64, xfer_id); if (tcpcl_analyze_sequence) { transfer_add_refuse(ctx, xfer_id, pinfo, tvb, tree_msg, item_msg); diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c index 5d9ce93bc9..2645ca5ad4 100644 --- a/epan/dissectors/packet-tds.c +++ b/epan/dissectors/packet-tds.c @@ -2341,7 +2341,7 @@ dissect_tds_type_varbyte(tvbuff_t *tvb, guint *offset, packet_info *pinfo, proto break; case 8: proto_tree_add_item(sub_tree, hf_tds_type_varbyte_data_int8, tvb, *offset + 1, 8, ENC_LITTLE_ENDIAN); - proto_item_append_text(item, " (%"G_GINT64_MODIFIER"d)", tvb_get_letoh64(tvb, *offset)); + proto_item_append_text(item, " (%"PRId64")", tvb_get_letoh64(tvb, *offset)); break; default: expert_add_info(pinfo, length_item, &ei_tds_invalid_length); @@ -2601,7 +2601,7 @@ dissect_tds_type_varbyte(tvbuff_t *tvb, guint *offset, packet_info *pinfo, proto } if(scale == 0) { proto_item_append_text(numericitem, - " (%" G_GINT64_MODIFIER "d)", + " (%" PRId64 ")", (sign ? -int64_value : int64_value)); } else { @@ -2661,7 +2661,7 @@ dissect_tds_type_varbyte(tvbuff_t *tvb, guint *offset, packet_info *pinfo, proto } if(scale == 0) { proto_item_append_text(numericitem, - " (%" G_GINT64_MODIFIER "d)", + " (%" PRId64 ")", (sign ? -int64_value : int64_value)); } else { @@ -3566,7 +3566,7 @@ dissect_tds5_capability_token(tvbuff_t *tvb, packet_info *pinfo, guint offset, case TDS_CAP_REQUEST: if (cap < array_length(hf_req_array)) { hf_array = hf_req_array[cap]; - g_snprintf(name, ITEM_LABEL_LENGTH, "Req caps %d-%d: ", + snprintf(name, ITEM_LABEL_LENGTH, "Req caps %d-%d: ", cap*8, (cap + 1)*8 - 1); ett = ett_tds_capability_req; } @@ -3574,7 +3574,7 @@ dissect_tds5_capability_token(tvbuff_t *tvb, packet_info *pinfo, guint offset, case TDS_CAP_RESPONSE: if (cap < array_length(hf_resp_array)) { hf_array = hf_resp_array[cap]; - g_snprintf(name, ITEM_LABEL_LENGTH, "Resp caps %d-%d: ", + snprintf(name, ITEM_LABEL_LENGTH, "Resp caps %d-%d: ", cap*8, (cap + 1)*8 - 1); ett = ett_tds_capability_resp; } @@ -7164,7 +7164,7 @@ version_convert( gchar *result, guint32 hexver ) * By specifying ENC_BIG_ENDIAN, the bytes have been swapped before we * see them. */ - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d", + snprintf( result, ITEM_LABEL_LENGTH, "%d.%d.%d", (hexver >> 24) & 0xFF, (hexver >> 16) & 0xFF, (hexver & 0xFFFF)); } diff --git a/epan/dissectors/packet-thrift.c b/epan/dissectors/packet-thrift.c index 5f275099a7..fc88c6ede3 100644 --- a/epan/dissectors/packet-thrift.c +++ b/epan/dissectors/packet-thrift.c @@ -593,7 +593,7 @@ dissect_thrift_field_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Create the field header sub-tree if requested only. */ if (tree != NULL) { header->fh_tree = proto_tree_add_subtree_format(tree, tvb, header->type_offset, *offset - header->type_offset, ett_thrift_field, NULL, - "Field Header #%" G_GINT64_MODIFIER "d", header->field_id); + "Field Header #%" PRId64, header->field_id); if (thrift_opt->tprotocol & PROTO_THRIFT_COMPACT) { header->type_pi = proto_tree_add_bits_item(header->fh_tree, hf_thrift_compact_struct_type, tvb, (header->type_offset << OCTETS_TO_BITS_SHIFT) + TCP_THRIFT_NIBBLE_SHIFT, TCP_THRIFT_NIBBLE_SHIFT, ENC_BIG_ENDIAN); header->fid_pi = proto_tree_add_bits_item(header->fh_tree, hf_thrift_fid_delta, tvb, header->type_offset << OCTETS_TO_BITS_SHIFT, TCP_THRIFT_NIBBLE_SHIFT, ENC_BIG_ENDIAN); @@ -893,7 +893,7 @@ dissect_thrift_t_field_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre /* Once we know it's the expected type (which is /not/ T_STOP), we can read the field id. */ if (field_header.field_id != (gint64)field_id) { expert_add_info_format(pinfo, field_header.fid_pi, &ei_thrift_wrong_field_id, - "Sub-dissector expects field id = %d, found %" G_GINT64_MODIFIER "d instead.", field_id, field_header.field_id); + "Sub-dissector expects field id = %d, found %" PRId64 " instead.", field_id, field_header.field_id); } /* Expose the field header sub-tree if requested. */ @@ -2757,7 +2757,7 @@ dissect_thrift_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int o thrift_opt->reassembly_length = TBP_THRIFT_TYPE_LEN; if (thrift_opt->reply_field_id != 0) { expert_add_info(pinfo, fid_pi, &ei_thrift_application_exception); - proto_item_set_text(data_pi, "Exception: %" G_GINT64_MODIFIER "d", thrift_opt->reply_field_id); + proto_item_set_text(data_pi, "Exception: %" PRId64, thrift_opt->reply_field_id); } if (is_compact) { diff --git a/epan/dissectors/packet-tibia.c b/epan/dissectors/packet-tibia.c index 7baa37c991..7e6daebbbd 100644 --- a/epan/dissectors/packet-tibia.c +++ b/epan/dissectors/packet-tibia.c @@ -1487,7 +1487,7 @@ dissect_tibia(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *fragmen } offset += len; } else /* account number */ { - char *accnum = wmem_strdup_printf(pinfo->pool, "%" G_GUINT32_FORMAT, tvb_get_letohl(tvb_decrypted, offset)); + char *accnum = wmem_strdup_printf(pinfo->pool, "%" PRIu32, tvb_get_letohl(tvb_decrypted, offset)); proto_tree_add_string(tibia_tree, hf_tibia_acc_number, tvb_decrypted, offset, 4, accnum); if (!convo->acc) convo->acc = (guint8*)wmem_strdup(wmem_file_scope(), accnum); diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c index 76d87c0710..d3ee0a7a52 100644 --- a/epan/dissectors/packet-tipc.c +++ b/epan/dissectors/packet-tipc.c @@ -578,7 +578,7 @@ tipc_addr_value_to_buf(guint tipc_address, gchar *buf, int buf_len) tipc_address = tipc_address >> 12; zone = tipc_address & 0xff; - g_snprintf(buf, buf_len, "%u.%u.%u", zone, subnetwork, processor); + snprintf(buf, buf_len, "%u.%u.%u", zone, subnetwork, processor); return buf; } diff --git a/epan/dissectors/packet-tls-utils.c b/epan/dissectors/packet-tls-utils.c index 16b25cb8f6..ef2b203fb4 100644 --- a/epan/dissectors/packet-tls-utils.c +++ b/epan/dissectors/packet-tls-utils.c @@ -2055,7 +2055,7 @@ quic_transport_parameter_id_base_custom(gchar *result, guint64 parameter_id) } else { label = val_to_str_const((guint32)parameter_id, quic_transport_parameter_id, "Unknown"); } - g_snprintf(result, ITEM_LABEL_LENGTH, "%s (0x%02" G_GINT64_MODIFIER "x)", label, parameter_id); + snprintf(result, ITEM_LABEL_LENGTH, "%s (0x%02" PRIx64 ")", label, parameter_id); } /* we keep this internal to packet-tls-utils, as there should be @@ -4284,7 +4284,7 @@ create_decoders: ssl_session->client_new->flow = ssl_session->client ? ssl_session->client->flow : ssl_create_flow(); ssl_session->server_new->flow = ssl_session->server ? ssl_session->server->flow : ssl_create_flow(); - ssl_debug_printf("%s: client seq %" G_GUINT64_FORMAT ", server seq %" G_GUINT64_FORMAT "\n", + ssl_debug_printf("%s: client seq %" PRIu64 ", server seq %" PRIu64 "\n", G_STRFUNC, ssl_session->client_new->seq, ssl_session->server_new->seq); g_free(key_block.data); ssl_session->state |= SSL_HAVE_SESSION_KEY; @@ -4592,7 +4592,7 @@ dtls_check_mac(SslDecoder*decoder, gint ct,int ver, guint8* data, if (ssl_hmac_setkey(&hm,decoder->mac_key.data,decoder->mac_key.data_len) != 0) return -1; - ssl_debug_printf("dtls_check_mac seq: %" G_GUINT64_FORMAT " epoch: %d\n",decoder->seq,decoder->epoch); + ssl_debug_printf("dtls_check_mac seq: %" PRIu64 " epoch: %d\n",decoder->seq,decoder->epoch); /* hash sequence number */ phton64(buf, decoder->seq); buf[0]=decoder->epoch>>8; @@ -4748,7 +4748,7 @@ tls_decrypt_aead_record(SslDecryptSession *ssl, SslDecoder *decoder, memcpy(nonce, decoder->write_iv.data, decoder->write_iv.data_len); /* Sequence number is left-padded with zeroes and XORed with write_iv */ phton64(nonce + nonce_len - 8, pntoh64(nonce + nonce_len - 8) ^ decoder->seq); - ssl_debug_printf("%s seq %" G_GUINT64_FORMAT "\n", G_STRFUNC, decoder->seq); + ssl_debug_printf("%s seq %" PRIu64 "\n", G_STRFUNC, decoder->seq); } /* Set nonce and additional authentication data */ @@ -5037,7 +5037,7 @@ ssl_decrypt_record(SslDecryptSession *ssl, SslDecoder *decoder, guint8 ct, guint } /* Now check the MAC */ - ssl_debug_printf("checking mac (len %d, version %X, ct %d seq %" G_GUINT64_FORMAT ")\n", + ssl_debug_printf("checking mac (len %d, version %X, ct %d seq %" PRIu64 ")\n", worklen, ssl->session.version, ct, decoder->seq); if(ssl->session.version==SSLV3_VERSION){ if(ssl3_check_mac(decoder,ct,mac_frag,mac_fraglen,mac) < 0) { @@ -6384,7 +6384,7 @@ ssl_association_info_(const gchar *table _U_, gpointer handle, gpointer user_dat { ssl_association_info_callback_data_t* data = (ssl_association_info_callback_data_t*)user_data; const int l = (const int)strlen(data->str); - g_snprintf(data->str+l, SSL_ASSOC_MAX_LEN-l, "'%s' %s\n", dissector_handle_get_short_name((dissector_handle_t)handle), data->table_protocol); + snprintf(data->str+l, SSL_ASSOC_MAX_LEN-l, "'%s' %s\n", dissector_handle_get_short_name((dissector_handle_t)handle), data->table_protocol); } /** @@ -7635,7 +7635,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv * quic_transport_parameter_id assumes that. If larger (up to 62 * bits) TPs are available, then it needs to be revisited. */ - proto_item_append_text(parameter_tree, ": Unknown 0x%08" G_GINT64_MODIFIER "x", parameter_type); + proto_item_append_text(parameter_tree, ": Unknown 0x%08" PRIx64, parameter_type); } else { proto_item_append_text(parameter_tree, ": %s", val_to_str((guint32)parameter_type, quic_transport_parameter_id, "Unknown 0x%04x")); } @@ -7655,7 +7655,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_MAX_IDLE_TIMEOUT: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_max_idle_timeout, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u ms", value); + proto_item_append_text(parameter_tree, " %" PRIu64 " ms", value); offset += len; break; case SSL_HND_QUIC_TP_STATELESS_RESET_TOKEN: @@ -7666,44 +7666,44 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_MAX_UDP_PAYLOAD_SIZE: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_max_udp_payload_size, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); /*TODO display expert info about invalid value (< 1252 or >65527) ? */ offset += len; break; case SSL_HND_QUIC_TP_INITIAL_MAX_DATA: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_initial_max_data, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_initial_max_stream_data_bidi_local, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_initial_max_stream_data_bidi_remote, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_initial_max_stream_data_uni, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_INITIAL_MAX_STREAMS_UNI: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_initial_max_streams_uni, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_INITIAL_MAX_STREAMS_BIDI: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_initial_max_streams_bidi, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_ACK_DELAY_EXPONENT: @@ -7715,7 +7715,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_MAX_ACK_DELAY: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_max_ack_delay, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_DISABLE_ACTIVE_MIGRATION: @@ -7761,7 +7761,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_ACTIVE_CONNECTION_ID_LIMIT: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_active_connection_id_limit, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_INITIAL_SOURCE_CONNECTION_ID: @@ -7777,7 +7777,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_MAX_DATAGRAM_FRAME_SIZE: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_max_datagram_frame_size, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_LOSS_BITS: @@ -7791,7 +7791,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_MIN_ACK_DELAY: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_min_ack_delay, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u", value); + proto_item_append_text(parameter_tree, " %" PRIu64, value); offset += len; break; case SSL_HND_QUIC_TP_GOOGLE_USER_AGENT: @@ -7824,7 +7824,7 @@ ssl_dissect_hnd_hello_ext_quic_transport_parameters(ssl_common_dissect_t *hf, tv case SSL_HND_QUIC_TP_GOOGLE_INITIAL_RTT: proto_tree_add_item_ret_varint(parameter_tree, hf->hf.hs_ext_quictp_parameter_google_initial_rtt, tvb, offset, -1, ENC_VARINT_QUIC, &value, &len); - proto_item_append_text(parameter_tree, " %" G_GINT64_MODIFIER "u us", value); + proto_item_append_text(parameter_tree, " %" PRIu64 " us", value); offset += len; break; case SSL_HND_QUIC_TP_GOOGLE_SUPPORT_HANDSHAKE_DONE: diff --git a/epan/dissectors/packet-tls.c b/epan/dissectors/packet-tls.c index 4a0fd3033c..6b8c0db0eb 100644 --- a/epan/dissectors/packet-tls.c +++ b/epan/dissectors/packet-tls.c @@ -3559,11 +3559,11 @@ void ssl_set_master_secret(guint32 frame_num, address *addr_srv, address *addr_c /* TODO change API to accept 64-bit sequence numbers. */ if (ssl->client && (client_seq != (guint32)-1)) { ssl->client->seq = client_seq; - ssl_debug_printf("ssl_set_master_secret client->seq updated to %" G_GUINT64_FORMAT "\n", ssl->client->seq); + ssl_debug_printf("ssl_set_master_secret client->seq updated to %" PRIu64 "\n", ssl->client->seq); } if (ssl->server && (server_seq != (guint32)-1)) { ssl->server->seq = server_seq; - ssl_debug_printf("ssl_set_master_secret server->seq updated to %" G_GUINT64_FORMAT "\n", ssl->server->seq); + ssl_debug_printf("ssl_set_master_secret server->seq updated to %" PRIu64 "\n", ssl->server->seq); } /* update IV from last data */ @@ -4078,7 +4078,7 @@ ssl_src_prompt(packet_info *pinfo, gchar *result) if (pi != NULL) srcport = pi->srcport; - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW); } static gpointer @@ -4103,7 +4103,7 @@ ssl_dst_prompt(packet_info *pinfo, gchar *result) if (pi != NULL) destport = pi->destport; - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, destport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, destport); } static gpointer @@ -4132,7 +4132,7 @@ ssl_both_prompt(packet_info *pinfo, gchar *result) destport = pi->destport; } - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); } static void diff --git a/epan/dissectors/packet-tns.c b/epan/dissectors/packet-tns.c index ba17fdd95a..1d3b40f3a1 100644 --- a/epan/dissectors/packet-tns.c +++ b/epan/dissectors/packet-tns.c @@ -481,7 +481,7 @@ static void vsnum_to_vstext_basecustom(gchar *result, guint32 vsnum) * Translate hex value to human readable version value, described at * http://docs.oracle.com/cd/B28359_01/server.111/b28310/dba004.htm */ - g_snprintf(result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d.%d", + snprintf(result, ITEM_LABEL_LENGTH, "%d.%d.%d.%d.%d", vsnum >> 24, (vsnum >> 20) & 0xf, (vsnum >> 12) & 0xf, diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c index 7c05f79281..4012b54a30 100644 --- a/epan/dissectors/packet-tpncp.c +++ b/epan/dissectors/packet-tpncp.c @@ -708,7 +708,7 @@ init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, FILE *file) while (fgetline(tpncp_db_entry, MAX_TPNCP_DB_ENTRY_LEN, file)) { special_type = TPNCP_NORMAL; since = 0; - g_snprintf(entry_copy, MAX_TPNCP_DB_ENTRY_LEN, "%s", tpncp_db_entry); + snprintf(entry_copy, MAX_TPNCP_DB_ENTRY_LEN, "%s", tpncp_db_entry); if (!strncmp(tpncp_db_entry, "#####", 5)) { hf_size--; break; @@ -908,7 +908,7 @@ init_tpncp_db(void) gchar tpncp_dat_file_path[MAX_TPNCP_DB_ENTRY_LEN]; FILE *file; - g_snprintf(tpncp_dat_file_path, MAX_TPNCP_DB_ENTRY_LEN, + snprintf(tpncp_dat_file_path, MAX_TPNCP_DB_ENTRY_LEN, "%s" G_DIR_SEPARATOR_S "tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir()); /* Open file with TPNCP data. */ diff --git a/epan/dissectors/packet-u3v.c b/epan/dissectors/packet-u3v.c index 55bd085fb3..9c52dd1a0f 100644 --- a/epan/dissectors/packet-u3v.c +++ b/epan/dissectors/packet-u3v.c @@ -1074,7 +1074,7 @@ get_register_name_from_address(guint64 addr, gboolean* is_custom_register, u3v_c } if (!address_string) { - address_string = wmem_strdup_printf(wmem_packet_scope(), "[Addr:0x%016" G_GINT64_MODIFIER "X]", addr); + address_string = wmem_strdup_printf(wmem_packet_scope(), "[Addr:0x%016" PRIX64 "]", addr); if (is_custom_register != NULL) { *is_custom_register = TRUE; } @@ -1368,7 +1368,7 @@ dissect_u3v_read_mem_cmd(proto_tree *u3v_telegram_tree, tvbuff_t *tvb, packet_in gencp_trans->count = count; if ( 0xffffffff00000000 & addr ) { - col_append_fstr(pinfo->cinfo, COL_INFO, " (0x%016" G_GINT64_MODIFIER "X (%d) bytes) %s", addr, count, address_string); + col_append_fstr(pinfo->cinfo, COL_INFO, " (0x%016" PRIX64 " (%d) bytes) %s", addr, count, address_string); } else { col_append_fstr(pinfo->cinfo, COL_INFO, " (0x%08X (%d) bytes)", (guint32)addr, count); } @@ -1621,7 +1621,7 @@ dissect_u3v_stream_leader(proto_tree *u3v_telegram_tree, tvbuff_t *tvb, packet_i offset += 2; /* Add payload type to information string */ - col_append_fstr(pinfo->cinfo, COL_INFO, "Stream Leader [ Block ID: %" G_GINT64_MODIFIER "u , Type %s]", + col_append_fstr(pinfo->cinfo, COL_INFO, "Stream Leader [ Block ID: %" PRIu64 " , Type %s]", block_id, val_to_str(payload_type, payload_type_names, "Unknown Payload Type")); @@ -1709,7 +1709,7 @@ dissect_u3v_stream_trailer(proto_tree *u3v_telegram_tree, tvbuff_t *tvb, packet_ offset += 8; /* Add payload type to information string */ - col_append_fstr(pinfo->cinfo, COL_INFO, "Stream Trailer [ Block ID: %" G_GINT64_MODIFIER "u]", block_id); + col_append_fstr(pinfo->cinfo, COL_INFO, "Stream Trailer [ Block ID: %" PRIu64 "]", block_id); if (tvb_captured_length_remaining(tvb,offset) >=4 ) { /* size_y */ diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c index aed3c345a9..b27a8195fb 100644 --- a/epan/dissectors/packet-ua3g.c +++ b/epan/dissectors/packet-ua3g.c @@ -699,7 +699,7 @@ version_number_computer( gchar *result, guint32 hexa_version ) release = (int)(hexa_version / 10000); vers = (int)((hexa_version % 10000) / 100); fix = (hexa_version % 10000) % 100; - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d.%02d", release, vers, fix); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d.%02d", release, vers, fix); } static void @@ -710,7 +710,7 @@ version_3bytes_computer(gchar *result, guint32 hexa_version) release = (hexa_version >> 16); vers = ((hexa_version >> 8) & 0xff); fix = (hexa_version & 0xff);; - g_snprintf(result, ITEM_LABEL_LENGTH, "%d.%02d.%02d", release, vers, fix); + snprintf(result, ITEM_LABEL_LENGTH, "%d.%02d.%02d", release, vers, fix); } diff --git a/epan/dissectors/packet-uavcan-can.c b/epan/dissectors/packet-uavcan-can.c index 0a58ebe2ec..7bfdf28467 100644 --- a/epan/dissectors/packet-uavcan-can.c +++ b/epan/dissectors/packet-uavcan-can.c @@ -460,9 +460,9 @@ UAVCAN_addr_to_str(const address *addr, gchar *buf, int buf_len) const guint16 *addrdata = (const guint16 *) addr->data; if ((*addrdata & ANONYMOUS_FLAG) != 0) { - return (int) g_snprintf(buf, buf_len, "Anonymous"); + return (int) snprintf(buf, buf_len, "Anonymous"); } else if ((*addrdata & BROADCAST_FLAG) != 0) { - return (int) g_snprintf(buf, buf_len, "Broadcast"); + return (int) snprintf(buf, buf_len, "Broadcast"); } else { guint8 real_addr = (guint8) (*addrdata & ADDR_MASK); guint32_to_str_buf(real_addr, buf, buf_len); diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c index 60f6b92bda..37f3acd327 100644 --- a/epan/dissectors/packet-udp.c +++ b/epan/dissectors/packet-udp.c @@ -128,7 +128,7 @@ udp_src_prompt(packet_info *pinfo, gchar *result) guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_udp_srcport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", port, UTF8_RIGHTWARDS_ARROW); } static gpointer @@ -143,7 +143,7 @@ udp_dst_prompt(packet_info *pinfo, gchar *result) guint32 port = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_udp_dstport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, port); } static gpointer @@ -159,7 +159,7 @@ udp_both_prompt(packet_info *pinfo, gchar *result) hf_udp_srcport, pinfo->curr_layer_num)); guint32 dstport = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, hf_udp_dstport, pinfo->curr_layer_num)); - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, dstport); + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, dstport); } /* Conversation and process code originally copied from packet-tcp.c */ diff --git a/epan/dissectors/packet-uds.c b/epan/dissectors/packet-uds.c index 01126a651b..f7656e393d 100644 --- a/epan/dissectors/packet-uds.c +++ b/epan/dissectors/packet-uds.c @@ -853,7 +853,7 @@ dissect_uds_internal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint1 UDS_RD_MAX_NUMBER_OF_BLOCK_LENGTH_OFFSET, max_number_of_block_length_length, ENC_BIG_ENDIAN); - col_append_fstr(pinfo->cinfo, COL_INFO, " Max Number Of Block Length 0x%" G_GINT64_MODIFIER "x", + col_append_fstr(pinfo->cinfo, COL_INFO, " Max Number Of Block Length 0x%" PRIx64, max_number_of_block_length); } else { guint8 data_format_identifier, compression, encryting; @@ -895,7 +895,7 @@ dissect_uds_internal(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint1 UDS_RD_MEMORY_ADDRESS_OFFSET + memory_address_length, memory_size_length, ENC_BIG_ENDIAN); - col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%" G_GINT64_MODIFIER "x bytes at 0x%" G_GINT64_MODIFIER "x", memory_size, memory_address); + col_append_fstr(pinfo->cinfo, COL_INFO, " 0x%" PRIx64 " bytes at 0x%" PRIx64, memory_size, memory_address); col_append_fstr(pinfo->cinfo, COL_INFO, " (Compression:0x%x Encrypting:0x%x)", compression, encryting); diff --git a/epan/dissectors/packet-umts_rlc.c b/epan/dissectors/packet-umts_rlc.c index a3db0c4ec5..6ba2accaca 100644 --- a/epan/dissectors/packet-umts_rlc.c +++ b/epan/dissectors/packet-umts_rlc.c @@ -656,7 +656,7 @@ add_description(proto_item *li_ti, proto_item *length_ti, va_list ap; va_start(ap, format); - g_vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); + vsnprintf(info_buffer, MAX_INFO_BUFFER, format, ap); va_end(ap); proto_item_append_text(li_ti, " (%s)", info_buffer); @@ -2095,11 +2095,11 @@ dissect_rlc_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guin bits = tvb_get_bits8(tvb, bit_offset, 8); for (l=0, j=0; l<8; l++) { if ((bits << l) & 0x80) { - j += g_snprintf(&buff[j], BUFF_SIZE-j, "%4u,", (unsigned)(sn+(8*i)+l)&0xfff); + j += snprintf(&buff[j], BUFF_SIZE-j, "%4u,", (unsigned)(sn+(8*i)+l)&0xfff); col_append_fstr(pinfo->cinfo, COL_INFO, " %u", (unsigned)(sn+(8*i)+l)&0xfff); number_of_bitmap_entries++; } else { - j += g_snprintf(&buff[j], BUFF_SIZE-j, " ,"); + j += snprintf(&buff[j], BUFF_SIZE-j, " ,"); } } proto_tree_add_string_format(bitmap_tree, hf_rlc_bitmap_string, tvb, bit_offset/8, 1, buff, "%s", buff); diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 265955d88e..945d197fdb 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -1616,7 +1616,7 @@ static int usb_addr_to_str(const address* addr, gchar *buf, int buf_len _U_) if(pletoh32(&addrp[0])==0xffffffff){ (void) g_strlcpy(buf, "host", buf_len); } else { - g_snprintf(buf, buf_len, "%d.%d.%d", pletoh16(&addrp[8]), + snprintf(buf, buf_len, "%d.%d.%d", pletoh16(&addrp[8]), pletoh32(&addrp[0]), pletoh32(&addrp[4])); } @@ -1642,7 +1642,7 @@ static int usb_addr_str_len(const address* addr _U_) static void usb_device_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Bus ID %u \nDevice Address %u\nas ", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Bus ID %u \nDevice Address %u\nas ", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_BUS_ID)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_ADDRESS))); } @@ -1658,7 +1658,7 @@ usb_device_value(packet_info *pinfo) static void usb_product_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor ID 0x%04x \nProduct ID 0x%04x\nas ", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Vendor ID 0x%04x \nProduct ID 0x%04x\nas ", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_VENDOR_ID)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_PRODUCT_ID))); } @@ -1674,7 +1674,7 @@ usb_product_value(packet_info *pinfo) static void usb_protocol_prompt(packet_info *pinfo, gchar* result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Class ID 0x%04x \nSubclass ID 0x%04x\nProtocol 0x%04x\nas ", + snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Class ID 0x%04x \nSubclass ID 0x%04x\nProtocol 0x%04x\nas ", GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_CLASS)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_SUBCLASS)), GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_usb, USB_DEVICE_PROTOCOL))); diff --git a/epan/dissectors/packet-usbll.c b/epan/dissectors/packet-usbll.c index 326d356447..5ad55be5f0 100644 --- a/epan/dissectors/packet-usbll.c +++ b/epan/dissectors/packet-usbll.c @@ -798,11 +798,11 @@ static int usbll_addr_to_str(const address* addr, gchar *buf, int buf_len) * In split transaction we use : to mark that the last part is port not * endpoint. */ - g_snprintf(buf, buf_len, "%d:%d", addrp->device, + snprintf(buf, buf_len, "%d:%d", addrp->device, addrp->endpoint); } else { /* Just a standard address.endpoint notation. */ - g_snprintf(buf, buf_len, "%d.%d", addrp->device, + snprintf(buf, buf_len, "%d.%d", addrp->device, addrp->endpoint); } diff --git a/epan/dissectors/packet-vsip.c b/epan/dissectors/packet-vsip.c index 3fb0d6f1e7..0d37efcf18 100644 --- a/epan/dissectors/packet-vsip.c +++ b/epan/dissectors/packet-vsip.c @@ -1754,7 +1754,7 @@ static int dissect_vsip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static void vsip_fmt_revision( gchar *result, guint32 revision ) { - g_snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); + snprintf( result, ITEM_LABEL_LENGTH, "%d.%02d", (guint8)(( revision & 0xFF00 ) >> 8), (guint8)(revision & 0xFF) ); } void proto_register_vsip(void) diff --git a/epan/dissectors/packet-vsock.c b/epan/dissectors/packet-vsock.c index 73899a162a..689d7cbfe6 100644 --- a/epan/dissectors/packet-vsock.c +++ b/epan/dissectors/packet-vsock.c @@ -104,7 +104,7 @@ static int vsock_addr_to_str(const address* addr, gchar *buf, int buf_len) if(pletoh64(&addrp[0])==2){ (void) g_strlcpy(buf, "host", buf_len); } else { - g_snprintf(buf, buf_len, "%" G_GINT64_MODIFIER "u", pletoh64(&addrp[0])); + snprintf(buf, buf_len, "%" PRIu64, pletoh64(&addrp[0])); } return (int)(strlen(buf)+1); diff --git a/epan/dissectors/packet-wai.c b/epan/dissectors/packet-wai.c index 2bcd2dfeea..a50b5b7797 100644 --- a/epan/dissectors/packet-wai.c +++ b/epan/dissectors/packet-wai.c @@ -512,7 +512,7 @@ dissect_identity_list(tvbuff_t *tvb, guint offset, proto_tree *tree) for(i=0; i < no_of_ids; i++) { gchar number[4] = {0}; - g_snprintf(number, 4, "%d", i); + snprintf(number, 4, "%d", i); offset += dissect_identity(tvb, offset, id_list_tree, number); } diff --git a/epan/dissectors/packet-wassp.c b/epan/dissectors/packet-wassp.c index ab3765c3ad..29bcc46dbe 100644 --- a/epan/dissectors/packet-wassp.c +++ b/epan/dissectors/packet-wassp.c @@ -4382,7 +4382,7 @@ static const char* wassp_match_strval(const WASSP_SUBTLV_DECODER_INFO_t *in_ptr, static void port_range_print(char *buf, guint32 temp) { - g_snprintf(buf, ITEM_LABEL_LENGTH, " %d - %d", (temp & 0xffff), (temp >> 16)); + snprintf(buf, ITEM_LABEL_LENGTH, " %d - %d", (temp & 0xffff), (temp >> 16)); } @@ -4396,27 +4396,27 @@ static void topology_moder_print(char *buf, guint16 temp) { case 0xc000: if (temp4) - g_snprintf(buf, ITEM_LABEL_LENGTH, " Routed At Controller with vlanId = %d (0x%x)", temp4, temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Routed At Controller with vlanId = %d (0x%x)", temp4, temp); else - g_snprintf(buf, ITEM_LABEL_LENGTH, " Routed At Controller, Untagged (0x%x)", temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Routed At Controller, Untagged (0x%x)", temp); break; case 0x4000: if (temp4) - g_snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At AP with vlanId = %d (0x%x)", temp4, temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At AP with vlanId = %d (0x%x)", temp4, temp); else - g_snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At AP, Untagged (0x%x) ", temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At AP, Untagged (0x%x) ", temp); break; case 0x8000: if (temp4) - g_snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At Controller with vlanId = %d (0x%x) ", temp4, temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At Controller with vlanId = %d (0x%x) ", temp4, temp); else - g_snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At Controller, Untagged (0x%x) ", temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Bridge At Controller, Untagged (0x%x) ", temp); break; default: if (temp4) - g_snprintf(buf, ITEM_LABEL_LENGTH, " Unknown mode with vlanId = %d (0x%x)", temp4, temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Unknown mode with vlanId = %d (0x%x)", temp4, temp); else - g_snprintf(buf, ITEM_LABEL_LENGTH, " Unknown mode, Untagged (0x%x) ", temp); + snprintf(buf, ITEM_LABEL_LENGTH, " Unknown mode, Untagged (0x%x) ", temp); break; } } @@ -4426,19 +4426,19 @@ static void topology_moder_print(char *buf, guint16 temp) static void maskbit_priority_print(char *buf, guint8 temp) { - g_snprintf(buf, ITEM_LABEL_LENGTH, " Type of Service Mask bits : %d Priority TxQ : %d", (temp >> 4) & 0xf, temp & 0xf); + snprintf(buf, ITEM_LABEL_LENGTH, " Type of Service Mask bits : %d Priority TxQ : %d", (temp >> 4) & 0xf, temp & 0xf); } static void cos_priority_txq_print(char *buf, guint8 temp) { - g_snprintf(buf, ITEM_LABEL_LENGTH, " Class of Service priority bits : %d Class of Service Transmit Queue : %d", (temp >> 4) & 0xf, temp & 0xf); + snprintf(buf, ITEM_LABEL_LENGTH, " Class of Service priority bits : %d Class of Service Transmit Queue : %d", (temp >> 4) & 0xf, temp & 0xf); } static void cos_rate_id_print(char *buf, guint8 temp) { - g_snprintf(buf, ITEM_LABEL_LENGTH, " Class of Service Inbound Rate Limit ID : %d Class of Service Outbound Rate Limit ID : %d", (temp >> 4) & 0xf, temp & 0xf); + snprintf(buf, ITEM_LABEL_LENGTH, " Class of Service Inbound Rate Limit ID : %d Class of Service Outbound Rate Limit ID : %d", (temp >> 4) & 0xf, temp & 0xf); } @@ -5599,11 +5599,11 @@ static void mu_association_status(char *buf, guint8 value) { if (value == 1) - g_snprintf(buf, ITEM_LABEL_LENGTH, " Success (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, " Success (%d)", value); else if (value == 2) - g_snprintf(buf, ITEM_LABEL_LENGTH, " Reject (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, " Reject (%d)", value); else - g_snprintf(buf, ITEM_LABEL_LENGTH, " Failure (%d)", value); + snprintf(buf, ITEM_LABEL_LENGTH, " Failure (%d)", value); } diff --git a/epan/dissectors/packet-windows-common.c b/epan/dissectors/packet-windows-common.c index b868de724f..1242c8dbcb 100644 --- a/epan/dissectors/packet-windows-common.c +++ b/epan/dissectors/packet-windows-common.c @@ -1547,13 +1547,13 @@ dissect_nt_sid(tvbuff_t *tvb, int offset, proto_tree *parent_tree, } sid_in_dec_str = wmem_strbuf_new_label(wmem_packet_scope()); - wmem_strbuf_append_printf (sid_in_dec_str, "S-%u-%" G_GINT64_MODIFIER "u", revision, authority); + wmem_strbuf_append_printf (sid_in_dec_str, "S-%u-%" PRIu64, revision, authority); /* If sid_display_hex is set, sid_in_dec_str is still needed for looking up well-known SIDs*/ if (sid_display_hex) { sid_in_hex_str = wmem_strbuf_new_label(wmem_packet_scope()); - wmem_strbuf_append_printf (sid_in_hex_str, "S-%x-%" G_GINT64_MODIFIER "x", revision, authority); + wmem_strbuf_append_printf (sid_in_hex_str, "S-%x-%" PRIx64, revision, authority); } wkwn_sid1_str = wmem_strbuf_new_label(wmem_packet_scope()); diff --git a/epan/dissectors/packet-wireguard.c b/epan/dissectors/packet-wireguard.c index e2fd7adee6..50bb98a6d0 100644 --- a/epan/dissectors/packet-wireguard.c +++ b/epan/dissectors/packet-wireguard.c @@ -1533,7 +1533,7 @@ wg_dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *wg_tree, wg_packe proto_tree_add_item_ret_uint(wg_tree, hf_wg_receiver, tvb, 4, 4, ENC_LITTLE_ENDIAN, &receiver_id); col_append_fstr(pinfo->cinfo, COL_INFO, ", receiver=0x%08X", receiver_id); proto_tree_add_item_ret_uint64(wg_tree, hf_wg_counter, tvb, 8, 8, ENC_LITTLE_ENDIAN, &counter); - col_append_fstr(pinfo->cinfo, COL_INFO, ", counter=%" G_GUINT64_FORMAT, counter); + col_append_fstr(pinfo->cinfo, COL_INFO, ", counter=%" PRIu64, counter); gint packet_length = tvb_captured_length_remaining(tvb, 16); if (packet_length < AUTH_TAG_LENGTH) { diff --git a/epan/dissectors/packet-wtls.c b/epan/dissectors/packet-wtls.c index 0dd951e196..af18a2261c 100644 --- a/epan/dissectors/packet-wtls.c +++ b/epan/dissectors/packet-wtls.c @@ -782,22 +782,22 @@ dissect_wtls_handshake(proto_tree *tree, tvbuff_t *tvb, guint offset, guint coun { if (valMac != NULL) { - g_snprintf(valStr,1024,"%s, %s",valBulk,valMac); + snprintf(valStr,1024,"%s, %s",valBulk,valMac); } else { - g_snprintf(valStr,1024,"%s, Unknown MAC (0x%02x)",valBulk,tvb_get_guint8 (tvb, offset)); + snprintf(valStr,1024,"%s, Unknown MAC (0x%02x)",valBulk,tvb_get_guint8 (tvb, offset)); } } else { if (valMac != NULL) { - g_snprintf(valStr,1024,"Unknown Bulk (0x%02x), %s",value,valMac); + snprintf(valStr,1024,"Unknown Bulk (0x%02x), %s",value,valMac); } else { - g_snprintf(valStr,1024,"Unknown Bulk (0x%02x), Unknown MAC (0x%02x)",value, + snprintf(valStr,1024,"Unknown Bulk (0x%02x), Unknown MAC (0x%02x)",value, tvb_get_guint8 (tvb, offset)); } } diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c index 069075f9e2..3f53243678 100644 --- a/epan/dissectors/packet-wtp.c +++ b/epan/dissectors/packet-wtp.c @@ -386,7 +386,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) #endif /* Develop the string to put in the Info column */ - returned_length = g_snprintf(szInfo, SZINFO_SIZE, "WTP %s", + returned_length = snprintf(szInfo, SZINFO_SIZE, "WTP %s", val_to_str(pdut, vals_wtp_pdu_type, "Unknown PDU type 0x%x")); str_index += MIN(returned_length, SZINFO_SIZE-str_index); @@ -396,7 +396,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) TID = tvb_get_ntohs(tvb, offCur + 1); psn = 0; clsTransaction = transaction_class(tvb_get_guint8(tvb, offCur + 3)); - returned_length = g_snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, + returned_length = snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, " Class %d", clsTransaction); str_index += MIN(returned_length, SZINFO_SIZE-str_index); cbHeader = 4; @@ -408,7 +408,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) TID = tvb_get_ntohs(tvb, offCur + 1); psn = tvb_get_guint8(tvb, offCur + 3); if (psn != 0) { - returned_length = g_snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, + returned_length = snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, " (%u)", psn); str_index += MIN(returned_length, SZINFO_SIZE-str_index); } @@ -440,7 +440,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; }; if (fRID) { - /*returned_length =*/ g_snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, " R" ); + /*returned_length =*/ snprintf(&szInfo[str_index], SZINFO_SIZE-str_index, " R" ); /*str_index += MIN(returned_length, SZINFO_SIZE-str_index);*/ }; /* In the interest of speed, if "tree" is NULL, don't do any work not diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c index a0a035e54a..410f76110c 100644 --- a/epan/dissectors/packet-x11.c +++ b/epan/dissectors/packet-x11.c @@ -5013,7 +5013,7 @@ static void dissect_x11_requests(tvbuff_t *tvb, packet_info *pinfo, */ if (tmp > G_MAXINT32) { ti = proto_tree_add_item(tree, proto_x11, tvb, offset, -1, ENC_NA); - expert_add_info_format(pinfo, ti, &ei_x11_request_length, "Bogus request length (%"G_GINT64_MODIFIER"d)", tmp); + expert_add_info_format(pinfo, ti, &ei_x11_request_length, "Bogus request length (%"PRId64")", tmp); return; } plen = (gint)tmp; diff --git a/epan/dissectors/packet-xtp.c b/epan/dissectors/packet-xtp.c index fcfa143103..7672cde215 100644 --- a/epan/dissectors/packet-xtp.c +++ b/epan/dissectors/packet-xtp.c @@ -469,12 +469,12 @@ dissect_xtp_traffic_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /** add summary **/ col_append_fstr(pinfo->cinfo, COL_INFO, - " Recv-Seq=%" G_GINT64_MODIFIER "u", tcntl->rseq); + " Recv-Seq=%" PRIu64, tcntl->rseq); col_append_fstr(pinfo->cinfo, COL_INFO, - " Alloc=%" G_GINT64_MODIFIER "u", tcntl->alloc); + " Alloc=%" PRIu64, tcntl->alloc); proto_item_append_text(top_ti, - ", Recv-Seq: %" G_GINT64_MODIFIER "u", tcntl->rseq); + ", Recv-Seq: %" PRIu64, tcntl->rseq); /** display **/ offset = start; @@ -673,12 +673,12 @@ dissect_xtp_cntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /** add summary **/ col_append_fstr(pinfo->cinfo, COL_INFO, - " Recv-Seq=%" G_GINT64_MODIFIER "u", cntl->rseq); + " Recv-Seq=%" PRIu64, cntl->rseq); col_append_fstr(pinfo->cinfo, COL_INFO, - " Alloc=%" G_GINT64_MODIFIER "u", cntl->alloc); + " Alloc=%" PRIu64, cntl->alloc); proto_item_append_text(top_ti, - ", Recv-Seq: %" G_GINT64_MODIFIER "u", cntl->rseq); + ", Recv-Seq: %" PRIu64, cntl->rseq); /** display **/ offset = start; @@ -763,12 +763,12 @@ dissect_xtp_ecntl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /** add summary **/ col_append_fstr(pinfo->cinfo, COL_INFO, - " Recv-Seq=%" G_GINT64_MODIFIER "u", ecntl->rseq); + " Recv-Seq=%" PRIu64, ecntl->rseq); col_append_fstr(pinfo->cinfo, COL_INFO, - " Alloc=%" G_GINT64_MODIFIER "u", ecntl->alloc); + " Alloc=%" PRIu64, ecntl->alloc); proto_item_append_text(top_ti, - ", Recv-Seq: %" G_GINT64_MODIFIER "u", ecntl->rseq); + ", Recv-Seq: %" PRIu64, ecntl->rseq); /** display **/ offset = start; @@ -941,7 +941,7 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) for (i = 0; i < 16; i++) { bpos = 1 << (15 - i); if (cmd_options & bpos) { - returned_length = g_snprintf(&options[fpos], + returned_length = snprintf(&options[fpos], MAX_OPTIONS_LEN-fpos, "%s%s", fpos?", ":"", fstr[i]); @@ -954,16 +954,16 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) pformat_vals, "Unknown pformat (%u)")); col_append_fstr(pinfo->cinfo, COL_INFO, " [%s]", options); col_append_fstr(pinfo->cinfo, COL_INFO, - " Seq=%" G_GINT64_MODIFIER "u", xtph->seq); + " Seq=%" PRIu64, xtph->seq); col_append_fstr(pinfo->cinfo, COL_INFO, " Len=%u", xtph->dlen); /* if (tree) */ { ti = proto_tree_add_item(tree, proto_xtp, tvb, 0, -1, ENC_NA); /** add summary **/ proto_item_append_text(ti, - ", Key: 0x%016" G_GINT64_MODIFIER "X", xtph->key); + ", Key: 0x%016" PRIX64, xtph->key); proto_item_append_text(ti, - ", Seq: %" G_GINT64_MODIFIER "u", xtph->seq); + ", Seq: %" PRIu64, xtph->seq); proto_item_append_text(ti, ", Len: %u", xtph->dlen); xtp_tree = proto_item_add_subtree(ti, ett_xtp); diff --git a/epan/dissectors/packet-yami.c b/epan/dissectors/packet-yami.c index e498949b28..8bf44edab6 100644 --- a/epan/dissectors/packet-yami.c +++ b/epan/dissectors/packet-yami.c @@ -135,7 +135,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item * case YAMI_TYPE_LONGLONG: { gint64 val = tvb_get_letoh64(tvb, offset); - proto_item_append_text(ti, ", Type: long, Value: %" G_GINT64_MODIFIER "d", val); + proto_item_append_text(ti, ", Type: long, Value: %" PRId64, val); proto_tree_add_item(yami_param, hf_yami_param_value_long, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; break; @@ -262,7 +262,7 @@ dissect_yami_parameter(tvbuff_t *tvb, proto_tree *tree, int offset, proto_item * for (i = 0; i < count; i++) { gint64 val = tvb_get_letoh64(tvb, offset); - proto_item_append_text(ti, "%" G_GINT64_MODIFIER "d, ", val); + proto_item_append_text(ti, "%" PRId64 ", ", val); proto_tree_add_item(yami_param, hf_yami_param_value_long, tvb, offset, 8, ENC_LITTLE_ENDIAN); offset += 8; } diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c index ecb8e1bd61..2212bb388c 100644 --- a/epan/dissectors/packet-zbee-nwk.c +++ b/epan/dissectors/packet-zbee-nwk.c @@ -375,7 +375,7 @@ static int zbee_nwk_address_to_str(const address* addr, gchar *buf, int buf_len) return (int)g_strlcpy(buf, "Broadcast", buf_len) + 1; } else { - return g_snprintf(buf, buf_len, "0x%04x", zbee_nwk_addr) + 1; + return snprintf(buf, buf_len, "0x%04x", zbee_nwk_addr) + 1; } } diff --git a/epan/dissectors/packet-zbee-zcl-general.c b/epan/dissectors/packet-zbee-zcl-general.c index e04fa733db..963c618b77 100644 --- a/epan/dissectors/packet-zbee-zcl-general.c +++ b/epan/dissectors/packet-zbee-zcl-general.c @@ -570,7 +570,7 @@ dissect_zbee_zcl_power_config(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_t static void decode_power_conf_voltage(gchar *s, guint32 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [V]", value/10, value%10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [V]", value/10, value%10); return; } /*decode_power_conf_voltage*/ @@ -589,7 +589,7 @@ decode_power_conf_voltage(gchar *s, guint32 value) static void decode_power_conf_percentage(gchar *s, guint32 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.1f [%%]", value/2.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.1f [%%]", value/2.0); return; } /*decode_power_conf_percentage*/ @@ -609,13 +609,13 @@ static void decode_power_conf_frequency(gchar *s, guint32 value) { if(value == 0x00) - g_snprintf(s, ITEM_LABEL_LENGTH, "Frequency too low to be measured (or DC supply)"); + snprintf(s, ITEM_LABEL_LENGTH, "Frequency too low to be measured (or DC supply)"); else if(value == 0xfe) - g_snprintf(s, ITEM_LABEL_LENGTH, "Frequency too high to be measured"); + snprintf(s, ITEM_LABEL_LENGTH, "Frequency too high to be measured"); else if (value == 0xff) - g_snprintf(s, ITEM_LABEL_LENGTH, "Frequency could not be measured"); + snprintf(s, ITEM_LABEL_LENGTH, "Frequency could not be measured"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d [Hz]", value*2); + snprintf(s, ITEM_LABEL_LENGTH, "%d [Hz]", value*2); return; } /*decode_power_conf_frequency*/ @@ -634,7 +634,7 @@ decode_power_conf_frequency(gchar *s, guint32 value) static void decode_power_conf_batt_AHr(gchar *s, guint32 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d [mAHr]", value*10); + snprintf(s, ITEM_LABEL_LENGTH, "%d [mAHr]", value*10); return; } /*decode_power_conf_batt_AHr*/ @@ -2294,7 +2294,7 @@ static const value_string zbee_zcl_scenes_color_loop_direction_values[] = { static void decode_color_xy(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.4lf", value/65535.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.4lf", value/65535.0); } /*FUNCTION:------------------------------------------------------ @@ -2311,7 +2311,7 @@ decode_color_xy(gchar *s, guint16 value) */ static void decode_setpoint(gchar *s, gint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2lf [" UTF8_DEGREE_SIGN "C]", value/100.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.2lf [" UTF8_DEGREE_SIGN "C]", value/100.0); } /*FUNCTION:------------------------------------------------------ @@ -9952,13 +9952,13 @@ static void decode_zcl_ota_curr_time(gchar *s, guint32 value) { if (value == ZBEE_ZCL_OTA_TIME_NOW) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Now"); + snprintf(s, ITEM_LABEL_LENGTH, "Now"); } else { gchar *tmp; value += ZBEE_ZCL_NSTIME_UTC_OFFSET; tmp = abs_time_secs_to_str(NULL, value, ABSOLUTE_TIME_LOCAL, 1); - g_snprintf(s, ITEM_LABEL_LENGTH, "%s", tmp); + snprintf(s, ITEM_LABEL_LENGTH, "%s", tmp); wmem_free(NULL, tmp); } @@ -9979,12 +9979,12 @@ static void decode_zcl_ota_req_time(gchar *s, guint32 value) { if (value == ZBEE_ZCL_OTA_TIME_WAIT) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Wrong Value"); + snprintf(s, ITEM_LABEL_LENGTH, "Wrong Value"); } else { /* offset from now */ gchar *tmp = signed_time_secs_to_str(NULL, value); - g_snprintf(s, ITEM_LABEL_LENGTH, "%s from now", tmp); + snprintf(s, ITEM_LABEL_LENGTH, "%s from now", tmp); wmem_free(NULL, tmp); } @@ -10005,12 +10005,12 @@ static void decode_zcl_ota_upgr_time(gchar *s, guint32 value) { if (value == ZBEE_ZCL_OTA_TIME_WAIT) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Wait for upgrade command"); + snprintf(s, ITEM_LABEL_LENGTH, "Wait for upgrade command"); } else { /* offset from now */ gchar *tmp = signed_time_secs_to_str(NULL, value); - g_snprintf(s, ITEM_LABEL_LENGTH, "%s from now", tmp); + snprintf(s, ITEM_LABEL_LENGTH, "%s from now", tmp); wmem_free(NULL, tmp); } @@ -10030,7 +10030,7 @@ decode_zcl_ota_upgr_time(gchar *s, guint32 value) static void decode_zcl_ota_size_in_bytes(gchar *s, guint32 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d [Bytes]", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d [Bytes]", value); } /*decode_zcl_ota_size_in_bytes*/ /*FUNCTION:------------------------------------------------------ @@ -11796,10 +11796,10 @@ static void decode_power_profile_id(gchar *s, guint8 id) { if (id == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (All)", id); + snprintf(s, ITEM_LABEL_LENGTH, "%d (All)", id); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d", id); + snprintf(s, ITEM_LABEL_LENGTH, "%d", id); } } /*decode_power_profile_id*/ @@ -11819,7 +11819,7 @@ decode_power_profile_id(gchar *s, guint8 id) static void decode_price_in_cents(gchar *s, guint32 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d cents", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d cents", value); } /* decode_price_in_cents */ @@ -11838,7 +11838,7 @@ decode_price_in_cents(gchar *s, guint32 value) static void decode_power_in_watt(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d Watt", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d Watt", value); } /* decode_power_in_watt */ /*FUNCTION:------------------------------------------------------ @@ -11856,7 +11856,7 @@ decode_power_in_watt(gchar *s, guint16 value) static void decode_energy(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d Watt per hours", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d Watt per hours", value); } /* decode_energy */ /*FUNCTION:------------------------------------------------------ @@ -11875,10 +11875,10 @@ static void func_decode_delayinminute(gchar *s, guint16 value) { if (value == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (Not permitted)", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes (Not permitted)", value); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", value); } } /* func_decode_delayinminute*/ diff --git a/epan/dissectors/packet-zbee-zcl-ha.c b/epan/dissectors/packet-zbee-zcl-ha.c index 3c716ee724..84d9e011bc 100644 --- a/epan/dissectors/packet-zbee-zcl-ha.c +++ b/epan/dissectors/packet-zbee-zcl-ha.c @@ -226,7 +226,7 @@ dissect_zcl_appl_idt_attr_data(proto_tree *tree, tvbuff_t *tvb, guint *offset, g case ZBEE_ZCL_ATTR_ID_APPL_IDT_BASIC_IDENT: value64 = tvb_get_letoh56(tvb, *offset); sub_tree = proto_tree_add_subtree_format(tree, tvb, *offset, 8, ett_zbee_zcl_appl_idt_basic, NULL, - "Basic Identification: 0x%" G_GINT64_MODIFIER "x", value64); + "Basic Identification: 0x%" PRIx64, value64); proto_tree_add_item(sub_tree, hf_zbee_zcl_appl_idt_company_id, tvb, *offset, 2, ENC_LITTLE_ENDIAN); *offset += 2; @@ -1194,12 +1194,12 @@ static void decode_zcl_appl_stats_utc_time(gchar *s, guint32 value) { if (value == ZBEE_ZCL_APPL_STATS_INVALID_TIME) - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid UTC Time"); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid UTC Time"); else { gchar *utc_time; value += ZBEE_ZCL_NSTIME_UTC_OFFSET; utc_time = abs_time_secs_to_str (NULL, value, ABSOLUTE_TIME_LOCAL, TRUE); - g_snprintf(s, ITEM_LABEL_LENGTH, "%s", utc_time); + snprintf(s, ITEM_LABEL_LENGTH, "%s", utc_time); wmem_free(NULL, utc_time); } } /* decode_zcl_appl_stats_utc_time */ diff --git a/epan/dissectors/packet-zbee-zcl-lighting.c b/epan/dissectors/packet-zbee-zcl-lighting.c index 3092a59b15..1c40840217 100644 --- a/epan/dissectors/packet-zbee-zcl-lighting.c +++ b/epan/dissectors/packet-zbee-zcl-lighting.c @@ -860,7 +860,7 @@ dissect_zcl_color_control_step_color_temp(tvbuff_t *tvb, proto_tree *tree, guint static void decode_color_xy(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%.4lf", value/65535.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.4lf", value/65535.0); return; } /*decode_power_conf_voltage*/ @@ -880,9 +880,9 @@ static void decode_color_temperature(gchar *s, guint16 value) { if (value == 0) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired]", value); + snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired]", value); } else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired] (%u [K])", value, 1000000/value); + snprintf(s, ITEM_LABEL_LENGTH, "%u [Mired] (%u [K])", value, 1000000/value); } return; } /*decode_color_temperature*/ @@ -904,7 +904,7 @@ decode_startup_color_temperature(gchar *s, guint16 value) { if (value == 0xffff) { - g_snprintf(s, ITEM_LABEL_LENGTH, "Set the Color Temperature attribute to its previous value"); + snprintf(s, ITEM_LABEL_LENGTH, "Set the Color Temperature attribute to its previous value"); } else { diff --git a/epan/dissectors/packet-zbee-zcl-meas-sensing.c b/epan/dissectors/packet-zbee-zcl-meas-sensing.c index 69e8876f04..0186149db6 100644 --- a/epan/dissectors/packet-zbee-zcl-meas-sensing.c +++ b/epan/dissectors/packet-zbee-zcl-meas-sensing.c @@ -184,12 +184,12 @@ static void decode_illum_meas_value(gchar *s, guint16 value) { if (value == ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_TOO_LOW_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Value too low to be measured"); + snprintf(s, ITEM_LABEL_LENGTH, "Value too low to be measured"); else if (value == ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_INVALID_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); else /* calculate lux value from measured value according to doc 07-5123-04 */ - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); + snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); return; } /*decode_illum_meas_value*/ @@ -205,9 +205,9 @@ decode_illum_meas_min_value(gchar *s, guint16 value) { if ( (value < ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_MIN_LO_VALUE) || (value > ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_MIN_HI_VALUE) ) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); + snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); return; } /*decode_illum_meas_min_value*/ @@ -223,9 +223,9 @@ decode_illum_meas_max_value(gchar *s, guint16 value) { if ( (value < ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_MAX_LO_VALUE) || (value > ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_MAX_HI_VALUE) ) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); + snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); return; } /*decode_illum_meas_max_value*/ @@ -240,9 +240,9 @@ static void decode_illum_meas_tolerance(gchar *s, guint16 value) { if (value > ZBEE_ZCL_ATTR_ID_ILLUM_MEAS_TOL_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d", value); return; } /*decode_illum_meas_tolerance*/ @@ -460,12 +460,12 @@ static void decode_illum_level_sen_target_level(gchar *s, guint16 value) { if (value == ZBEE_ZCL_ATTR_ID_ILLUM_LEVEL_SEN_TOO_LOW_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Value too low to be measured"); + snprintf(s, ITEM_LABEL_LENGTH, "Value too low to be measured"); else if (value == ZBEE_ZCL_ATTR_ID_ILLUM_LEVEL_SEN_INVALID_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); else /* calculate lux value from measured value according to doc 07-5123-04 */ - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); + snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [lx])", value, pow(10,value/10000.0)-1); return; } /*decode_illum_level_sen_value*/ @@ -676,9 +676,9 @@ static void decode_temp_meas_value(gchar *s, gint16 value) { if (value == (gint16)ZBEE_ZCL_ATTR_ID_TEMP_MEAS_INVALID_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f [" UTF8_DEGREE_SIGN "C]", value/100.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f [" UTF8_DEGREE_SIGN "C]", value/100.0); return; } /*decode_temp_meas_value*/ @@ -694,9 +694,9 @@ decode_temp_meas_min_value(gchar *s, gint16 value) { if ( (value < (gint16)ZBEE_ZCL_ATTR_ID_TEMP_MEAS_MIN_LO_VALUE) || (value > (gint16)ZBEE_ZCL_ATTR_ID_TEMP_MEAS_MIN_HI_VALUE) ) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f [" UTF8_DEGREE_SIGN "C]", value/100.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f [" UTF8_DEGREE_SIGN "C]", value/100.0); return; } /*decode_temp_meas_min_value*/ @@ -711,9 +711,9 @@ static void decode_temp_meas_max_value(gchar *s, gint16 value) { if (value < (gint16)ZBEE_ZCL_ATTR_ID_TEMP_MEAS_MAX_LO_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%.2f [" UTF8_DEGREE_SIGN "C]", value/100.0); + snprintf(s, ITEM_LABEL_LENGTH, "%.2f [" UTF8_DEGREE_SIGN "C]", value/100.0); return; } /*decode_temp_meas_max_value*/ @@ -728,9 +728,9 @@ static void decode_temp_meas_tolerance(gchar *s, guint16 value) { if (value > ZBEE_ZCL_ATTR_ID_TEMP_MEAS_TOL_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [" UTF8_DEGREE_SIGN "C]", value/100, value%100); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [" UTF8_DEGREE_SIGN "C]", value/100, value%100); return; } /*decode_temp_meas_tolerance*/ @@ -985,11 +985,11 @@ static void decode_press_meas_value(gchar *s, gint16 value) { if (value == (gint16)ZBEE_ZCL_ATTR_ID_PRESS_MEAS_INVALID_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); if (value < (gint16)ZBEE_ZCL_ATTR_ID_PRESS_MEAS_MIN_LO_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); return; } /*decode_press_meas_value*/ @@ -1004,9 +1004,9 @@ static void decode_press_meas_min_value(gchar *s, gint16 value) { if (value > (gint16)ZBEE_ZCL_ATTR_ID_PRESS_MEAS_MIN_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); return; } /*decode_press_meas_min_value*/ @@ -1021,9 +1021,9 @@ static void decode_press_meas_max_value(gchar *s, gint16 value) { if (value < (gint16)ZBEE_ZCL_ATTR_ID_PRESS_MEAS_MAX_LO_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); return; } /*decode_press_meas_max_value*/ @@ -1038,9 +1038,9 @@ static void decode_press_meas_tolerance(gchar *s, guint16 value) { if (value > (guint16)ZBEE_ZCL_ATTR_ID_PRESS_MEAS_TOL_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d [kPa]", value/10, value%10); return; } /*decode_press_meas_tolerance*/ @@ -1272,12 +1272,12 @@ static void decode_flow_meas_value(gchar *s, guint16 value) { if (value == ZBEE_ZCL_ATTR_ID_FLOW_MEAS_TOO_LOW_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Value too low to be measured"); + snprintf(s, ITEM_LABEL_LENGTH, "Value too low to be measured"); else if (value == ZBEE_ZCL_ATTR_ID_FLOW_MEAS_INVALID_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); else /* calculate flow value from measured value according to doc 07-5123-04 */ - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [m^3/h])", value, value/10.0); + snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [m^3/h])", value, value/10.0); return; } /*decode_flow_meas_value*/ @@ -1293,9 +1293,9 @@ decode_flow_meas_min_value(gchar *s, guint16 value) { if ( /*(value < ZBEE_ZCL_ATTR_ID_FLOW_MEAS_MIN_LO_VALUE) ||*/ (value > ZBEE_ZCL_ATTR_ID_FLOW_MEAS_MIN_HI_VALUE) ) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [m^3/h])", value, value/10.0); + snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [m^3/h])", value, value/10.0); return; } /*decode_flow_meas_min_value*/ @@ -1311,9 +1311,9 @@ decode_flow_meas_max_value(gchar *s, guint16 value) { if ( (value < ZBEE_ZCL_ATTR_ID_FLOW_MEAS_MAX_LO_VALUE) || (value > ZBEE_ZCL_ATTR_ID_FLOW_MEAS_MAX_HI_VALUE) ) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [m^3/h])", value, value/10.0); + snprintf(s, ITEM_LABEL_LENGTH, "%d (=%f [m^3/h])", value, value/10.0); return; } /*decode_flow_meas_max_value*/ @@ -1328,9 +1328,9 @@ static void decode_flow_meas_tolerance(gchar *s, guint16 value) { if (value > ZBEE_ZCL_ATTR_ID_FLOW_MEAS_TOL_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d", value); return; } /*decode_flow_meas_tolerance*/ @@ -1543,9 +1543,9 @@ static void decode_relhum_meas_value(gchar *s, guint16 value) { if (value == ZBEE_ZCL_ATTR_ID_RELHUM_MEAS_INVALID_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); + snprintf(s, ITEM_LABEL_LENGTH, "Invalid value"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); return; } /*decode_relhum_meas_value*/ @@ -1560,9 +1560,9 @@ static void decode_relhum_meas_min_value(gchar *s, guint16 value) { if (value > ZBEE_ZCL_ATTR_ID_RELHUM_MEAS_MIN_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); return; } /*decode_relhum_meas_min_value*/ @@ -1577,9 +1577,9 @@ static void decode_relhum_meas_max_value(gchar *s, guint16 value) { if (value > ZBEE_ZCL_ATTR_ID_RELHUM_MEAS_MAX_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); return; } /*decode_relhum_meas_max_value*/ @@ -1594,9 +1594,9 @@ static void decode_relhum_meas_tolerance(gchar *s, guint16 value) { if (value > ZBEE_ZCL_ATTR_ID_RELHUM_MEAS_TOL_HI_VALUE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); + snprintf(s, ITEM_LABEL_LENGTH, "Out of range"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%02d [%%]", value/100, value%100); return; } /*decode_relhum_meas_tolerance*/ diff --git a/epan/dissectors/packet-zbee-zcl-se.c b/epan/dissectors/packet-zbee-zcl-se.c index dfa61a1c7a..7f8aeb4e23 100644 --- a/epan/dissectors/packet-zbee-zcl-se.c +++ b/epan/dissectors/packet-zbee-zcl-se.c @@ -3857,11 +3857,11 @@ static void decode_zcl_drlc_temp_offset(gchar *s, guint8 value) { if (value == ZBEE_ZCL_DRLC_TEMP_OFFSET_NOT_USED) - g_snprintf(s, ITEM_LABEL_LENGTH, "Not Used"); + snprintf(s, ITEM_LABEL_LENGTH, "Not Used"); else { gfloat temp_delta; temp_delta = value / ZBEE_ZCL_DRLC_TEMP_OFFSET_DIVIDER; - g_snprintf(s, ITEM_LABEL_LENGTH, "%+.2f%s", temp_delta, units_degree_celsius.singular); + snprintf(s, ITEM_LABEL_LENGTH, "%+.2f%s", temp_delta, units_degree_celsius.singular); } } /*decode_zcl_msg_start_time*/ @@ -3874,11 +3874,11 @@ decode_zcl_drlc_temp_offset(gchar *s, guint8 value) static void decode_zcl_drlc_temp_set_point(gchar *s, gint16 value) { if (value & ZBEE_ZCL_DRLC_TEMP_SET_POINT_NOT_USED) - g_snprintf(s, ITEM_LABEL_LENGTH, "Not Used"); + snprintf(s, ITEM_LABEL_LENGTH, "Not Used"); else { gfloat temp_delta; temp_delta = value / ZBEE_ZCL_DRLC_TEMP_SET_POINT_DIVIDER; - g_snprintf(s, ITEM_LABEL_LENGTH, "%+.2f%s", temp_delta, units_degree_celsius.singular); + snprintf(s, ITEM_LABEL_LENGTH, "%+.2f%s", temp_delta, units_degree_celsius.singular); } } /*decode_zcl_drlc_temp_set_point*/ @@ -3891,9 +3891,9 @@ static void decode_zcl_drlc_temp_set_point(gchar *s, gint16 value) static void decode_zcl_drlc_average_load_adjustment_percentage(gchar *s, gint8 value) { if (value & ZBEE_ZCL_DRLC_AVERAGE_LOAD_ADJUSTMENT_PERCENTAGE) - g_snprintf(s, ITEM_LABEL_LENGTH, "Not Used"); + snprintf(s, ITEM_LABEL_LENGTH, "Not Used"); else { - g_snprintf(s, ITEM_LABEL_LENGTH, "%+d%%", value); + snprintf(s, ITEM_LABEL_LENGTH, "%+d%%", value); } } /*decode_zcl_drlc_average_load_adjustment_percentage*/ @@ -8308,9 +8308,9 @@ static void decode_zcl_msg_duration(gchar *s, guint16 value) { if (value == 0xffff) - g_snprintf(s, ITEM_LABEL_LENGTH, "Until changed"); + snprintf(s, ITEM_LABEL_LENGTH, "Until changed"); else - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", value); return; } /*decode_zcl_msg_duration*/ @@ -8325,12 +8325,12 @@ static void decode_zcl_msg_start_time(gchar *s, guint32 value) { if (value == ZBEE_ZCL_MSG_START_TIME_NOW) - g_snprintf(s, ITEM_LABEL_LENGTH, "Now"); + snprintf(s, ITEM_LABEL_LENGTH, "Now"); else { gchar *start_time; time_t epoch_time = (time_t)value + ZBEE_ZCL_NSTIME_UTC_OFFSET; start_time = abs_time_secs_to_str (NULL, epoch_time, ABSOLUTE_TIME_UTC, TRUE); - g_snprintf(s, ITEM_LABEL_LENGTH, "%s", start_time); + snprintf(s, ITEM_LABEL_LENGTH, "%s", start_time); wmem_free(NULL, start_time); } } /* decode_zcl_msg_start_time */ diff --git a/epan/dissectors/packet-zbee-zcl.c b/epan/dissectors/packet-zbee-zcl.c index c1705414f1..eac60bedc3 100644 --- a/epan/dissectors/packet-zbee-zcl.c +++ b/epan/dissectors/packet-zbee-zcl.c @@ -1854,7 +1854,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint case ZBEE_ZCL_16_BIT_BITMAP: proto_tree_add_item(tree, hf_zbee_zcl_attr_bitmap16, tvb, *offset, 2, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Bitmap: %04" G_GINT16_MODIFIER "x", tvb_get_letohs(tvb, *offset)); + proto_item_append_text(tree, ", Bitmap: %04" PRIx16, tvb_get_letohs(tvb, *offset)); (*offset) += 2; break; @@ -1884,7 +1884,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint case ZBEE_ZCL_24_BIT_BITMAP: proto_tree_add_item(tree, hf_zbee_zcl_attr_bitmap24, tvb, *offset, 3, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Bitmap: %06" G_GINT32_MODIFIER "x", tvb_get_letoh24(tvb, *offset)); + proto_item_append_text(tree, ", Bitmap: %06" PRIx32, tvb_get_letoh24(tvb, *offset)); (*offset) += 3; break; @@ -1915,7 +1915,7 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint case ZBEE_ZCL_32_BIT_BITMAP: proto_tree_add_item(tree, hf_zbee_zcl_attr_bitmap32, tvb, *offset, 4, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Bitmap: %08" G_GINT32_MODIFIER "x", tvb_get_letohl(tvb, *offset)); + proto_item_append_text(tree, ", Bitmap: %08" PRIx32, tvb_get_letohl(tvb, *offset)); (*offset) += 4; break; @@ -1944,19 +1944,19 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint case ZBEE_ZCL_40_BIT_BITMAP: proto_tree_add_item(tree, hf_zbee_zcl_attr_bitmap40, tvb, *offset, 5, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Bitmap: %010" G_GINT64_MODIFIER "x", tvb_get_letoh40(tvb, *offset)); + proto_item_append_text(tree, ", Bitmap: %010" PRIx64, tvb_get_letoh40(tvb, *offset)); (*offset) += 5; break; case ZBEE_ZCL_40_BIT_UINT: proto_tree_add_item(tree, hf_zbee_zcl_attr_uint40, tvb, *offset, 5, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Uint: %" G_GINT64_MODIFIER "u", tvb_get_letoh40(tvb, *offset)); + proto_item_append_text(tree, ", Uint: %" PRIu64, tvb_get_letoh40(tvb, *offset)); (*offset) += 5; break; case ZBEE_ZCL_40_BIT_INT: proto_tree_add_item(tree, hf_zbee_zcl_attr_int64, tvb, *offset, 5, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Int: %" G_GINT64_MODIFIER "d", tvb_get_letohi40(tvb, *offset)); + proto_item_append_text(tree, ", Int: %" PRId64, tvb_get_letohi40(tvb, *offset)); (*offset) += 5; break; @@ -1967,19 +1967,19 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint case ZBEE_ZCL_48_BIT_BITMAP: proto_tree_add_item(tree, hf_zbee_zcl_attr_bitmap48, tvb, *offset, 6, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Bitmap: %012" G_GINT64_MODIFIER "x", tvb_get_letoh48(tvb, *offset)); + proto_item_append_text(tree, ", Bitmap: %012" PRIx64, tvb_get_letoh48(tvb, *offset)); (*offset) += 6; break; case ZBEE_ZCL_48_BIT_UINT: proto_tree_add_item(tree, hf_zbee_zcl_attr_uint48, tvb, *offset, 6, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Uint: %" G_GINT64_MODIFIER "u", tvb_get_letoh48(tvb, *offset)); + proto_item_append_text(tree, ", Uint: %" PRIu64, tvb_get_letoh48(tvb, *offset)); (*offset) += 6; break; case ZBEE_ZCL_48_BIT_INT: proto_tree_add_item(tree, hf_zbee_zcl_attr_int64, tvb, *offset, 6, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Int: %" G_GINT64_MODIFIER "d", tvb_get_letohi48(tvb, *offset)); + proto_item_append_text(tree, ", Int: %" PRId64, tvb_get_letohi48(tvb, *offset)); (*offset) += 6; break; @@ -1990,19 +1990,19 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint case ZBEE_ZCL_56_BIT_BITMAP: proto_tree_add_item(tree, hf_zbee_zcl_attr_bitmap56, tvb, *offset, 7, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Bitmap: %014" G_GINT64_MODIFIER "x", tvb_get_letoh56(tvb, *offset)); + proto_item_append_text(tree, ", Bitmap: %014" PRIx64, tvb_get_letoh56(tvb, *offset)); (*offset) += 7; break; case ZBEE_ZCL_56_BIT_UINT: proto_tree_add_item(tree, hf_zbee_zcl_attr_uint56, tvb, *offset, 7, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Uint: %" G_GINT64_MODIFIER "u", tvb_get_letoh56(tvb, *offset)); + proto_item_append_text(tree, ", Uint: %" PRIu64, tvb_get_letoh56(tvb, *offset)); (*offset) += 7; break; case ZBEE_ZCL_56_BIT_INT: proto_tree_add_item(tree, hf_zbee_zcl_attr_int64, tvb, *offset, 7, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Int: %" G_GINT64_MODIFIER "d", tvb_get_letohi56(tvb, *offset)); + proto_item_append_text(tree, ", Int: %" PRId64, tvb_get_letohi56(tvb, *offset)); (*offset) += 7; break; @@ -2013,19 +2013,19 @@ void dissect_zcl_attr_data(tvbuff_t *tvb, proto_tree *tree, guint *offset, guint case ZBEE_ZCL_64_BIT_BITMAP: proto_tree_add_item(tree, hf_zbee_zcl_attr_bitmap64, tvb, *offset, 8, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Bitmap: %016" G_GINT64_MODIFIER "x", tvb_get_letoh64(tvb, *offset)); + proto_item_append_text(tree, ", Bitmap: %016" PRIx64, tvb_get_letoh64(tvb, *offset)); (*offset) += 8; break; case ZBEE_ZCL_64_BIT_UINT: proto_tree_add_item(tree, hf_zbee_zcl_attr_uint64, tvb, *offset, 8, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Uint: %" G_GINT64_MODIFIER "u", tvb_get_letoh64(tvb, *offset)); + proto_item_append_text(tree, ", Uint: %" PRIu64, tvb_get_letoh64(tvb, *offset)); (*offset) += 8; break; case ZBEE_ZCL_64_BIT_INT: proto_tree_add_item(tree, hf_zbee_zcl_attr_int64, tvb, *offset, 8, ENC_LITTLE_ENDIAN); - proto_item_append_text(tree, ", Int: %" G_GINT64_MODIFIER "u", tvb_get_letoh64(tvb, *offset)); + proto_item_append_text(tree, ", Int: %" PRIu64, tvb_get_letoh64(tvb, *offset)); (*offset) += 8; break; @@ -2304,7 +2304,7 @@ static void zcl_dump_data(tvbuff_t *tvb, guint offset, packet_info *pinfo, proto */ void decode_zcl_time_in_100ms(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d.%d seconds", value/10, value%10); + snprintf(s, ITEM_LABEL_LENGTH, "%d.%d seconds", value/10, value%10); return; } /* decode_zcl_time_in_100ms*/ @@ -2314,7 +2314,7 @@ void decode_zcl_time_in_100ms(gchar *s, guint16 value) */ void decode_zcl_time_in_seconds(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d seconds", value); return; } /* decode_zcl_time_in_seconds*/ @@ -2324,7 +2324,7 @@ void decode_zcl_time_in_seconds(gchar *s, guint16 value) */ void decode_zcl_time_in_minutes(gchar *s, guint16 value) { - g_snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", value); + snprintf(s, ITEM_LABEL_LENGTH, "%d minutes", value); return; } /*decode_zcl_time_in_minutes*/ diff --git a/epan/dissectors/packet-zbee-zdp.c b/epan/dissectors/packet-zbee-zdp.c index 1bd47c8d69..15a1a5b027 100644 --- a/epan/dissectors/packet-zbee-zdp.c +++ b/epan/dissectors/packet-zbee-zdp.c @@ -528,7 +528,7 @@ zbee_append_info(proto_item *item, packet_info *pinfo, const gchar *format, ...) va_list ap; va_start(ap, format); - g_vsnprintf(buffer, 512, format, ap); + vsnprintf(buffer, 512, format, ap); va_end(ap); proto_item_append_text(item, "%s", buffer); @@ -977,11 +977,11 @@ zdp_parse_complex_desc(packet_info *pinfo, proto_tree *tree, gint ettindex, tvbu lang_str[1] = tvb_get_guint8(tvb, *offset + 2); lang_str[2] = '\0'; - g_snprintf(complex, max_len, "<%s>%s, %s", tag_name[tag_charset], lang_str, charset_str, tag_name[tag_charset]); + snprintf(complex, max_len, "<%s>%s, %s", tag_name[tag_charset], lang_str, charset_str, tag_name[tag_charset]); } else if (tag == tag_icon) { /* TODO: */ - g_snprintf(complex, max_len, "<%s>FixMe", tag_name[tag_icon], tag_name[tag_icon]); + snprintf(complex, max_len, "<%s>FixMe", tag_name[tag_icon], tag_name[tag_icon]); } else { gchar *str; @@ -989,10 +989,10 @@ zdp_parse_complex_desc(packet_info *pinfo, proto_tree *tree, gint ettindex, tvbu str = (gchar *) tvb_get_string_enc(pinfo->pool, tvb, *offset+1, length-1, ENC_ASCII|ENC_NA); /* Handles all string type XML tags. */ if (tag <= tag_icon_url) { - g_snprintf(complex, max_len, "<%s>%s", tag_name[tag], str, tag_name[tag]); + snprintf(complex, max_len, "<%s>%s", tag_name[tag], str, tag_name[tag]); } else { - g_snprintf(complex, max_len, "<%s>%s", tag_name[0], str, tag_name[0]); + snprintf(complex, max_len, "<%s>%s", tag_name[0], str, tag_name[0]); } } if (tree) { diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 5009423715..8af358d1a0 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -3727,7 +3727,7 @@ pcapng_seek_read(wtap *wth, gint64 seek_off, if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) < 0) { return FALSE; /* Seek error */ } - ws_debug("reading at offset %" G_GINT64_MODIFIER "u", seek_off); + ws_debug("reading at offset %" PRIu64, seek_off); /* * Find the section_info_t for the section in which this block