diff --git a/src/methods.cpp b/src/methods.cpp index 012accb0c..83f0b1dc8 100644 --- a/src/methods.cpp +++ b/src/methods.cpp @@ -657,6 +657,8 @@ auto device_name_from_nde(NeoDeviceEx* nde) -> std::string icsneoGetDeviceName(const_cast(nde), &name[0], name.capacity(), EDevNameTypeNoSerial); length == 0) { return std::string("icsneoGetDeviceName() Failed"); + } else { + name.resize(length, '\0'); } return name; } catch (ice::Exception&) {