Initialize bufname, reported by Mark Kelly.

This commit is contained in:
nicm
2026-02-15 17:43:26 +00:00
parent 7e50eb0e83
commit 1f0c54f7ea

View File

@@ -57,14 +57,12 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item)
{ {
struct args *args = cmd_get_args(self); struct args *args = cmd_get_args(self);
struct client *tc = cmdq_get_target_client(item); struct client *tc = cmdq_get_target_client(item);
struct paste_buffer *pb; struct paste_buffer *pb = NULL;
char *bufname, *bufdata = NULL, *cause = NULL; char *bufname = NULL, *bufdata = NULL, *cause = NULL;
const char *olddata; const char *olddata;
size_t bufsize = 0, newsize; size_t bufsize = 0, newsize;
if (args_get(args, 'b') == NULL) if (args_get(args, 'b') != NULL) {
pb = NULL;
else {
bufname = xstrdup(args_get(args, 'b')); bufname = xstrdup(args_get(args, 'b'));
pb = paste_get_name(bufname); pb = paste_get_name(bufname);
} }