libicsneoc: Fixed access violation

This commit is contained in:
David Rebbe
2022-11-07 20:22:45 +00:00
parent 5ff1707c47
commit de58b2d639
+5
View File
@@ -486,6 +486,11 @@ bool icsneo_describeDevice(const neodevice_t* device, char* str, size_t* maxLeng
if(!icsneo_isValidNeoDevice(device))
return false;
if(!str) {
*maxLength = device->device->describe().length();
return false;
}
std::string output = device->device->describe();
*maxLength = output.copy(str, *maxLength);