mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-01-30 11:54:55 +01:00
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)
|
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)
|
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) {
|
if (serial_str) {
|
||||||
conf.have_serial = 1;
|
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)
|
if (ir_endpoint != 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user