diff --git a/libuavcan/src/transport/uc_can_io.cpp b/libuavcan/src/transport/uc_can_io.cpp index e3a45a4ef5..1d63196643 100644 --- a/libuavcan/src/transport/uc_can_io.cpp +++ b/libuavcan/src/transport/uc_can_io.cpp @@ -4,7 +4,7 @@ */ #include -#include +#include #include #include #include @@ -17,10 +17,13 @@ namespace uavcan */ std::string CanRxFrame::toString(StringRepresentation mode) const { - std::ostringstream os; - os << CanFrame::toString(mode) - << " ts_m=" << ts_mono << " ts_utc=" << ts_utc << " iface=" << int(iface_index); - return os.str(); + std::string out = CanFrame::toString(mode); + out.reserve(128); + out += " ts_m=" + ts_mono.toString(); + out += " ts_utc=" + ts_utc.toString(); + out += " iface="; + out += '0' + iface_index; + return out; } /*