diff options
| author | Riley Beckett <rbeckettvt@gmail.com> | 2025-10-25 00:18:30 -0400 |
|---|---|---|
| committer | Riley Beckett <rbeckettvt@gmail.com> | 2025-10-25 00:18:30 -0400 |
| commit | dd6f4cab47da3d35bc6d6c9a8eca8c77384f3bdc (patch) | |
| tree | b5f413632a2bc205cae8425e89864a4df5a9d093 /input_field.c | |
| parent | ecf6d868aa0fbf1f30c2a286a526018d412e7e28 (diff) | |
fix segfault
Diffstat (limited to 'input_field.c')
| -rw-r--r-- | input_field.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/input_field.c b/input_field.c index 7df1799..f6820d4 100644 --- a/input_field.c +++ b/input_field.c @@ -124,10 +124,8 @@ bool type_key(client_state* state, xkb_keysym_t keysym) { // paste if (keysym == XKB_KEY_v && ctrl) { - for (size_t i = 0; i < state->clipboard_size; ++i) { - array_insert(state->input_buffer, state->cursor_index, state->clipboard[i]); - ++state->cursor_index; - } + array_insert_many(state->input_buffer, state->cursor_index, state->clipboard, state->clipboard_size); + state->cursor_index += state->clipboard_size; update_text_buffer(state); |
