Fix strncpy warning

This should make gcc with -march=native happy.
This commit is contained in:
kyak 2023-12-11 11:05:51 +03:00
parent 5cc6a5b3e1
commit cb1344f702

View file

@ -769,8 +769,8 @@ output_add_virtual(struct server *server, const char *output_name)
return;
}
}
strncpy(server->headless.pending_output_name, output_name,
sizeof(server->headless.pending_output_name));
snprintf(server->headless.pending_output_name,
sizeof(server->headless.pending_output_name), "%s", output_name);
} else {
server->headless.pending_output_name[0] = '\0';
}