rtl_eeprom: fix warnings
Account for \0 string terminator when calling strncpy(). Fixes the following GCC 9 warning: warning: ‘__builtin_strncpy’ specified bound 256 equals destination size
This commit is contained in:
parent
81833a1cf6
commit
3c263b7451
|
@ -370,14 +370,14 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
if (manuf_str)
|
||||
strncpy((char*)&conf.manufacturer, manuf_str, MAX_STR_SIZE);
|
||||
strncpy((char*)&conf.manufacturer, manuf_str, MAX_STR_SIZE - 1);
|
||||
|
||||
if (product_str)
|
||||
strncpy((char*)&conf.product, product_str, MAX_STR_SIZE);
|
||||
strncpy((char*)&conf.product, product_str, MAX_STR_SIZE - 1);
|
||||
|
||||
if (serial_str) {
|
||||
conf.have_serial = 1;
|
||||
strncpy((char*)&conf.serial, serial_str, MAX_STR_SIZE);
|
||||
strncpy((char*)&conf.serial, serial_str, MAX_STR_SIZE - 1);
|
||||
}
|
||||
|
||||
if (ir_endpoint != 0)
|
||||
|
|
Loading…
Reference in New Issue