]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/output.c: fix strncpy warning
authorkyak <699631+kyak@users.noreply.github.com>
Mon, 11 Dec 2023 09:33:06 +0000 (12:33 +0300)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2023 09:33:06 +0000 (10:33 +0100)
Fixes #1307

src/output.c

index 5be82fb4cc0f198a28d57770480833b69085fdf3..6d7048bf3cb66486d6985f4f149d308c16b41a38 100644 (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';
        }