mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
rc_input: fix possible string truncation (-Werror=stringop-truncation)
This commit is contained in:
@@ -58,7 +58,7 @@ RCInput::RCInput(const char *device) :
|
||||
}
|
||||
|
||||
if (device) {
|
||||
strncpy(_device, device, sizeof(_device));
|
||||
strncpy(_device, device, sizeof(_device) - 1);
|
||||
_device[sizeof(_device) - 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user