src/output.c: fix strncpy warning

Fixes #1307
This commit is contained in:
kyak 2023-12-11 12:33:06 +03:00 committed by GitHub
parent 5cc6a5b3e1
commit 45e0dad3f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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