util: Use C version of snprintf
Change-Id: I7b7240af9c6e77bce64c051d8489903456c860c1
Refs: #2299
diff --git a/src/util/ethernet.cpp b/src/util/ethernet.cpp
index 34420b3..aa6b058 100644
--- a/src/util/ethernet.cpp
+++ b/src/util/ethernet.cpp
@@ -29,7 +29,7 @@
#include <boost/functional/hash.hpp>
-#include <cstdio>
+#include <stdio.h>
#include <ostream>
namespace ndn {
@@ -79,9 +79,11 @@
{
char s[18]; // 12 digits + 5 separators + null terminator
- // apparently gcc-4.6 does not support the 'hh' type modifier
- std::snprintf(s, sizeof(s), "%02x%c%02x%c%02x%c%02x%c%02x%c%02x",
- at(0), sep, at(1), sep, at(2), sep, at(3), sep, at(4), sep, at(5));
+ // - apparently gcc-4.6 does not support the 'hh' type modifier
+ // - std::snprintf not found in some environments
+ // http://redmine.named-data.net/issues/2299 for more information
+ snprintf(s, sizeof(s), "%02x%c%02x%c%02x%c%02x%c%02x%c%02x",
+ at(0), sep, at(1), sep, at(2), sep, at(3), sep, at(4), sep, at(5));
return std::string(s);
}