rc_input: fix possible string truncation (-Werror=stringop-truncation)

This commit is contained in:
Daniel Agar 2021-02-25 19:54:39 -05:00
parent e0ade94d25
commit 6b1e7ffdb8

View File

@ -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';
}
}