diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-09-07 18:50:45 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-09-07 18:50:45 +0000 |
commit | ccba613e5b277e70e8261c04ecc37ff3ef14a217 (patch) | |
tree | 26ed2fcf88ae87e4e76e922df255e4fd62589e31 /status.c | |
parent | e97006b102dd274dd8cc70c2aee13f6b09f69a41 (diff) | |
download | rtmux-ccba613e5b277e70e8261c04ecc37ff3ef14a217.tar.gz rtmux-ccba613e5b277e70e8261c04ecc37ff3ef14a217.tar.bz2 rtmux-ccba613e5b277e70e8261c04ecc37ff3ef14a217.zip |
Give each paste buffer a size member instead of requiring them to be
zero-terminated.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -928,9 +928,10 @@ status_prompt_key(struct client *c, int key) case MODEKEYEDIT_PASTE: if ((pb = paste_get_top(&c->session->buffers)) == NULL) break; - if ((last = strchr(pb->data, '\n')) == NULL) - last = strchr(pb->data, '\0'); - n = last - pb->data; + for (n = 0; n < pb->size; n++) { + if (pb->data[n] < 32 || pb->data[n] == 127) + break; + } c->prompt_buffer = xrealloc(c->prompt_buffer, 1, size + n + 1); if (c->prompt_index == size) { |