From b08b3296b8d46a14766cca4810a7b61738edee4b Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 28 Jun 2013 18:59:44 +0900 Subject: [PATCH] editor: Fix segfault when deleting the first character --- clients/editor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/editor.c b/clients/editor.c index d4e4e92f..3fb645bf 100644 --- a/clients/editor.c +++ b/clients/editor.c @@ -380,11 +380,11 @@ text_input_keysym(void *data, text_entry_commit_and_reset(entry); start = utf8_prev_char(entry->text, entry->text + entry->cursor); - end = utf8_next_char(start); - if (start == NULL) return; + end = utf8_next_char(start); + text_entry_delete_text(entry, start - entry->text, end - start);