diff --git a/libuavcan/src/uc_data_type.cpp b/libuavcan/src/uc_data_type.cpp index 736da7ee86..dd3784a2a0 100644 --- a/libuavcan/src/uc_data_type.cpp +++ b/libuavcan/src/uc_data_type.cpp @@ -2,9 +2,9 @@ * Copyright (C) 2014 Pavel Kirienko */ -#include #include -#include +#include +#include #include #include #include @@ -73,10 +73,12 @@ std::string DataTypeDescriptor::toString() const assert(0); } - std::ostringstream os; - os << full_name_ << ":" << id_.get() << kindch << ":" << std::hex - << std::setfill('0') << std::setw(16) << signature_.get(); - return os.str(); + using namespace std; // For snprintf() + char buf[80]; + (void)snprintf(buf, sizeof(buf), "%s:%u%c:%016llx", + full_name_, static_cast(id_.get()), kindch, + static_cast(signature_.get())); + return std::string(buf); } bool DataTypeDescriptor::operator==(const DataTypeDescriptor& rhs) const