[PATCH weston] editor: Fix segfault when deleting the first character

Kristian Høgsberg hoegsberg at gmail.com
Mon Jul 1 21:04:32 PDT 2013


On Fri, Jun 28, 2013 at 06:59:44PM +0900, Daiki Ueno wrote:
> 
> ---
>  clients/editor.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, committed.

Kristian

> diff --git a/clients/editor.c b/clients/editor.c
> index d4e4e92..3fb645b 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);
> -- 
> 1.8.3.1
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list