Please don't use prohibited APIs in new code:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 14 Jun 2011 20:37:53 +0000 (20:37 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 14 Jun 2011 20:37:53 +0000 (20:37 +0000)
sprintf -> g_snprintf

Fixes coverity 1197 & 1198.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37664 f5534014-38df-0310-8fa8-9805f1628bb7

epan/address_to_str.c
epan/ftypes/ftype-integer.c

index 8ee7b0e50eca050c0a7a71c18824046850b66abb..dfbd6851a2d986d0bae390a5847eec09d75d4990 100644 (file)
@@ -336,7 +336,7 @@ eui64_to_str(const guint64 ad) {
   /* Copy and convert the address to network byte order. */
   *(guint64 *)(void *)(p_eui64) = pntoh64(&(ad));
 
-  sprintf(buf, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", 
+  g_snprintf(buf, EUI64_STR_LEN, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", 
   p_eui64[0], p_eui64[1], p_eui64[2], p_eui64[3],
   p_eui64[4], p_eui64[5], p_eui64[6], p_eui64[7] );
   return buf;
index 38cd8d3cc09eda9368e51b0e1f97dd79e3cbf1ea..37ab5619fe0864f4ad0db1fcc51587143efeb855 100644 (file)
@@ -530,7 +530,7 @@ eui64_to_repr(fvalue_t *fv, ftrepr_t rtype _U_, char *buf)
        /* Copy and convert the address to network byte order. */
        *(guint64 *)(void *)(p_eui64) = pntoh64(&(fv->value.integer64));
 
-       sprintf(buf, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", 
+       g_snprintf(buf, EUI64_STR_LEN, "%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", 
        p_eui64[0], p_eui64[1], p_eui64[2], p_eui64[3],
        p_eui64[4], p_eui64[5], p_eui64[6], p_eui64[7] );
 }