From 5f32b7d9613e9ef3f8198302379a42630323da6a Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 20 Aug 2021 19:50:16 +0000 Subject: Hide struct args behind a couple of accessor functions. --- cmd-set-buffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd-set-buffer.c') diff --git a/cmd-set-buffer.c b/cmd-set-buffer.c index 94d8cd52..3005e62d 100644 --- a/cmd-set-buffer.c +++ b/cmd-set-buffer.c @@ -94,11 +94,11 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_NORMAL); } - if (args->argc != 1) { + if (args_count(args) != 1) { cmdq_error(item, "no data specified"); return (CMD_RETURN_ERROR); } - if ((newsize = strlen(args->argv[0])) == 0) + if ((newsize = strlen(args_string(args, 0))) == 0) return (CMD_RETURN_NORMAL); bufsize = 0; @@ -111,7 +111,7 @@ cmd_set_buffer_exec(struct cmd *self, struct cmdq_item *item) } bufdata = xrealloc(bufdata, bufsize + newsize); - memcpy(bufdata + bufsize, args->argv[0], newsize); + memcpy(bufdata + bufsize, args_string(args, 0), newsize); bufsize += newsize; if (paste_set(bufdata, bufsize, bufname, &cause) != 0) { -- cgit v1.2.3