summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'desktop')
-rw-r--r--desktop/textarea.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 39135b0c1..a15d64ca2 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1836,7 +1836,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
c_line = ta->caret_pos.line;
c_chars = ta->caret_pos.char_off;
- if (ta->text.data[b_off + b_len - 1] == ' '
+ if (b_len > 0 && ta->text.data[b_off + b_len - 1] == ' '
&& line < ta->line_count - 1)
b_len--;