diff options
author | Amadeusz Sławiński <amade@asmblr.net> | 2019-04-17 20:41:22 +0200 |
---|---|---|
committer | Amadeusz Sławiński <amade@asmblr.net> | 2019-04-17 20:41:22 +0200 |
commit | 50a8496eb3e0e444bcae6e44e3a72abfeed34472 (patch) | |
tree | 291304271406b6f6ebc0f4bfb73482a5d40ac6cd | |
parent | ceb9b1f6ec6378c83566af0029ddefcc825ba6d4 (diff) | |
download | screen-50a8496eb3e0e444bcae6e44e3a72abfeed34472.tar.gz |
Clean whole buffer if we don't want to parse it
Fixes problem when pressing arrows in some prompts causes arrows to stop
in other places.
For example pressing up arrow in 'kill --confirm' prompt stops up arrow
from working on 'windowlist'
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
-rw-r--r-- | src/list_window.c | 2 | ||||
-rw-r--r-- | src/process.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/list_window.c b/src/list_window.c index ae73f63..4b39f98 100644 --- a/src/list_window.c +++ b/src/list_window.c @@ -84,7 +84,7 @@ static void window_kill_confirm(char *buf, size_t len, void *data) struct action act; if (len || (*buf != 'y' && *buf != 'Y')) { - *buf = 0; + memset(buf, 0, len); return; } diff --git a/src/process.c b/src/process.c index 5c291f5..689b4fa 100644 --- a/src/process.c +++ b/src/process.c @@ -6634,7 +6634,7 @@ static void copy_reg_fn(char *buf, size_t len, void *data) struct plop *pp = plop_tab + (int)(unsigned char)*buf; if (len) { - *buf = 0; + memset(buf, 0, len); return; } if (pp->buf) @@ -6660,7 +6660,7 @@ static void ins_reg_fn(char *buf, size_t len, void *data) struct plop *pp = plop_tab + (int)(unsigned char)*buf; if (len) { - *buf = 0; + memset(buf, 0, len); return; } if (!fore) @@ -6681,7 +6681,7 @@ static void process_fn(char *buf, size_t len, void *data) (void)data; /* unused */ if (len) { - *buf = 0; + memset(buf, 0, len); return; } if (pp->buf) { @@ -6696,7 +6696,7 @@ static void confirm_fn(char *buf, size_t len, void *data) struct action act; if (len || (*buf != 'y' && *buf != 'Y')) { - *buf = 0; + memset(buf, 0, len); return; } act.nr = *(int *)data; |