summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-10-30 09:35:16 +0000
committerPhilip Withnall <philip.withnall@collabora.co.uk>2015-02-11 12:33:44 +0000
commitaaed5186fab6217994b72b078e3e7789be0df117 (patch)
tree6a51920eaea0271126b660cb1740d93c5fa1f9ee
parent925649e8c6ac8ce461fbf769dee0e2ce4d78e506 (diff)
downloadlibnice-aaed5186fab6217994b72b078e3e7789be0df117.tar.gz
stun: Use sprintf() instead of snprintf() to support VS 2010
Visual Studio 2010 still doesn’t support C99, and snprintf() is a C99 function, so compilation fails with: error: C3861: 'snprintf': identifier not found Use sprintf() instead, which is C89 and thus supported. This does not make the code unsafe, as the format specifier is constrained to two characters (+ trailing nul), which are guaranteed to fit in the array bounds. Reported on the mailing list: http://lists.freedesktop.org/archives/nice/2014-October/000978.html
-rw-r--r--stun/debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stun/debug.c b/stun/debug.c
index 598094d..f3a55bb 100644
--- a/stun/debug.c
+++ b/stun/debug.c
@@ -89,7 +89,7 @@ void stun_debug_bytes (const char *prefix, const void *data, size_t len)
strcpy (bytes + prefix_len, "0x");
for (i = 0; i < len; i++)
- snprintf (bytes + prefix_len + 2 + (i * 2), 3, "%02x", ((const unsigned char *)data)[i]);
+ sprintf (bytes + prefix_len + 2 + (i * 2), "%02x", ((const unsigned char *)data)[i]);
stun_debug ("%s", bytes);
}