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-bgp.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-bgp.c')
-rw-r--r-- | epan/dissectors/packet-bgp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index 6ca5173532..f1886c3f06 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -51,10 +51,6 @@ #include <string.h> #include <glib.h> -#ifdef NEED_SNPRINTF_H -# include "snprintf.h" -#endif - #include <epan/packet.h> #include <epan/addr_and_mask.h> #include "packet-bgp.h" @@ -481,11 +477,11 @@ decode_MPLS_stack(tvbuff_t *tvb, gint offset, char *buf, size_t buflen) /* withdrawn routes may contain 0 or 0x800000 in the first label */ if((index-offset)==0&&(label_entry==0||label_entry==0x800000)) { - snprintf(buf, buflen, "0 (withdrawn)"); + g_snprintf(buf, buflen, "0 (withdrawn)"); return (1); } - snprintf(junk_buf, sizeof(junk_buf),"%u%s", (label_entry >> 4), ((label_entry & 0x000001) == 0) ? "," : " (bottom)"); + g_snprintf(junk_buf, sizeof(junk_buf),"%u%s", (label_entry >> 4), ((label_entry & 0x000001) == 0) ? "," : " (bottom)"); if (strlen(buf) + strlen(junk_buf) + 1 <= buflen) strcat(buf, junk_buf); index += 3 ; |