summary refs log tree commit diff stats
path: root/src/fe-gtk/setup.c
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2015-06-04 04:02:33 -0400
committerTingPing <tingping@tingping.se>2015-06-04 04:02:33 -0400
commitafd2135393c4c4f759054bbadfce7accbef4e927 (patch)
treeacf4206b624fd73ca52a28972726874a751e6c10 /src/fe-gtk/setup.c
parent94ef0fd29480b8390b0adff625122db9e732ac5a (diff)
Fix possible overflow
gtk_entry_get_text_length() returns len in utf8
chars not in bytes
Diffstat (limited to 'src/fe-gtk/setup.c')
-rw-r--r--src/fe-gtk/setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c
index 11261560..dc469591 100644
--- a/src/fe-gtk/setup.c
+++ b/src/fe-gtk/setup.c
@@ -1169,8 +1169,8 @@ setup_entry_cb (GtkEntry *entry, setting *set)
 {
 	int size;
 	int pos;
-	int len = gtk_entry_get_text_length (entry);
 	unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
+	int len = strlen (p);
 
 	/* need to truncate? */
 	if (len >= set->extra)