diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-08-08 18:50:39 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-08-08 18:50:39 +0000 |
commit | 0dc9fb3d4ab00d14bf45c597471e10e601efd4d4 (patch) | |
tree | ae44175ca8fd23548fcec5833098b535af5e372c /epan/dissectors/packet-diameter.c | |
parent | f3407856f4fd97caf90655205cdb2c66991e75ba (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-diameter.c')
-rw-r--r-- | epan/dissectors/packet-diameter.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c index 20f6eeb3ae..0853412b8e 100644 --- a/epan/dissectors/packet-diameter.c +++ b/epan/dissectors/packet-diameter.c @@ -57,10 +57,6 @@ #include "packet-tcp.h" #include "packet-sip.h" -#ifdef NEED_SNPRINTF_H -# include "snprintf.h" -#endif - /* This must be defined before we include packet-diameter-defs.h */ /* Valid data types */ @@ -923,7 +919,7 @@ diameter_vendor_to_str(guint32 vendorId, gboolean longName) { } } - snprintf(buffer, sizeof(buffer), + g_snprintf(buffer, sizeof(buffer), "Vendor 0x%08x", vendorId); return buffer; } /*diameter_vendor_to_str */ @@ -965,7 +961,7 @@ diameter_command_to_str(guint32 commandCode, guint32 vendorId) if ( suppress_console_output == FALSE ) g_warning("Diameter: Unable to find name for command code 0x%08x, Vendor \"%u\"!", commandCode, vendorId); - snprintf(buffer, sizeof(buffer), + g_snprintf(buffer, sizeof(buffer), "Cmd-0x%08x", commandCode); break; case DIAMETER_RFC: @@ -980,7 +976,7 @@ diameter_command_to_str(guint32 commandCode, guint32 vendorId) if ( suppress_console_output == FALSE ) g_warning("Diameter: Unable to find name for command code 0x%08x!", commandCode); - snprintf(buffer, sizeof(buffer), + g_snprintf(buffer, sizeof(buffer), "Cmd-0x%08x", commandCode); break; } @@ -999,7 +995,7 @@ diameter_app_to_str(guint32 appId) { } } - snprintf(buffer, sizeof(buffer), "Unknown"); + g_snprintf(buffer, sizeof(buffer), "Unknown"); return buffer; } /*diameter_app_to_str */ |