summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2014-10-08 17:35:59 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2014-10-08 17:35:59 +0000
commitdc3a4c54a20ba89e33051d03b15794332510dd6e (patch)
treebe14ed549633da623be705739517d78eb3e8ea3c /usr.bin/tmux/status.c
parentffd63c643fb91665eb6cd4e412079a391a52b979 (diff)
Add xreallocarray and remove nmemb argument from xrealloc.
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r--usr.bin/tmux/status.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index 3b84c7823c4..ab3f07657b8 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.115 2014/10/02 10:39:43 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.116 2014/10/08 17:35:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -992,7 +992,7 @@ status_prompt_key(struct client *c, int key)
/* Insert the new word. */
size += strlen(s);
off = first - c->prompt_buffer;
- c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 1);
+ c->prompt_buffer = xrealloc(c->prompt_buffer, size + 1);
first = c->prompt_buffer + off;
memmove(first + strlen(s), first, n);
memcpy(first, s, strlen(s));
@@ -1170,7 +1170,7 @@ status_prompt_key(struct client *c, int key)
break;
}
- c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + n + 1);
+ c->prompt_buffer = xrealloc(c->prompt_buffer, size + n + 1);
if (c->prompt_index == size) {
memcpy(c->prompt_buffer + c->prompt_index, pb->data, n);
c->prompt_index += n;
@@ -1210,7 +1210,7 @@ status_prompt_key(struct client *c, int key)
case MODEKEY_OTHER:
if ((key & 0xff00) != 0 || key < 32 || key == 127)
break;
- c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + 2);
+ c->prompt_buffer = xrealloc(c->prompt_buffer, size + 2);
if (c->prompt_index == size) {
c->prompt_buffer[c->prompt_index++] = key;