判断设置序列号为空的适合

This commit is contained in:
13038267101 2024-02-06 10:16:04 +08:00
parent ca6d8c62c9
commit d401f76669
1 changed files with 5 additions and 1 deletions

View File

@ -4842,8 +4842,12 @@ int hg_scanner::device_io_control(unsigned long code, void* data, unsigned* len)
} }
else if (code == IO_CTRL_CODE_SET_SERIAL) else if (code == IO_CTRL_CODE_SET_SERIAL)
{ {
if (!data)
{
return SCANNER_ERR_INVALID_PARAMETER;
}
string str = (char*)data; string str = (char*)data;
return set_serial_num((char*)data); return set_serial_num(str.c_str());
} }
else if (code == IO_CTRL_CODE_GET_VIDPID) else if (code == IO_CTRL_CODE_GET_VIDPID)
{ {