Libug: fixed a compiler warning

This commit is contained in:
Martin Pulec
2021-03-16 16:29:14 +01:00
parent f1e6143411
commit c032cbd6fc

View File

@@ -239,7 +239,7 @@ struct ug_receiver *ug_receiver_start(struct ug_receiver_parameters *init_params
const char *display_cfg = "";
if (init_params->display != nullptr) {
strncpy(display, init_params->display, sizeof display);
strncpy(display, init_params->display, sizeof display - 1);
if (strchr(display, ':') != nullptr) {
display_cfg = strchr(display, ':') + 1;
*strchr(display, ':') = '\0';