aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ntp.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-08-08 18:50:39 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-08-08 18:50:39 +0000
commit0dc9fb3d4ab00d14bf45c597471e10e601efd4d4 (patch)
treeae44175ca8fd23548fcec5833098b535af5e372c /epan/dissectors/packet-ntp.c
parentf3407856f4fd97caf90655205cdb2c66991e75ba (diff)
various code cleanup:
-use g_snprintf instead of sprintf and snprintf -use g_strdup_printf where appropriate -remove #include "snprintf.h" (as only g_snprintf should be used) -replace some more alloc/realloc/calloc/free with their glib pendants svn path=/trunk/; revision=15264
Diffstat (limited to 'epan/dissectors/packet-ntp.c')
-rw-r--r--epan/dissectors/packet-ntp.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c
index 3629f1adcd..aa13cfc9de 100644
--- a/epan/dissectors/packet-ntp.c
+++ b/epan/dissectors/packet-ntp.c
@@ -36,10 +36,6 @@
#include <math.h>
#include <glib.h>
-#ifdef NEED_SNPRINTF_H
-# include "snprintf.h"
-#endif
-
#include <epan/packet.h>
#include <epan/addr_resolv.h>
#include "packet-ntp.h"
@@ -392,7 +388,7 @@ ntp_fmt_ts(const guint8 *reftime, char* buff)
bd = gmtime(&temptime);
if (bd != NULL) {
fractime = bd->tm_sec + tempfrac / 4294967296.0;
- snprintf(buff, NTP_TS_SIZE,
+ g_snprintf(buff, NTP_TS_SIZE,
"%s %2d, %d %02d:%02d:%07.4f UTC",
mon_names[bd->tm_mon],
bd->tm_mday,
@@ -550,7 +546,7 @@ dissect_ntp_std(tvbuff_t *tvb, proto_tree *ntp_tree, guint8 flags)
*/
refid = tvb_get_ptr(tvb, 12, 4);
if (stratum <= 1) {
- snprintf (buff, sizeof buff,
+ g_snprintf (buff, sizeof buff,
"Unindentified reference source '%.4s'",
refid);
for (i = 0; primary_sources[i].id; i++) {