libicsneoc: Fixed access violation
parent
5ff1707c47
commit
de58b2d639
|
|
@ -486,6 +486,11 @@ bool icsneo_describeDevice(const neodevice_t* device, char* str, size_t* maxLeng
|
||||||
if(!icsneo_isValidNeoDevice(device))
|
if(!icsneo_isValidNeoDevice(device))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if(!str) {
|
||||||
|
*maxLength = device->device->describe().length();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string output = device->device->describe();
|
std::string output = device->device->describe();
|
||||||
|
|
||||||
*maxLength = output.copy(str, *maxLength);
|
*maxLength = output.copy(str, *maxLength);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue