Fix possible overflow
gtk_entry_get_text_length() returns len in utf8 chars not in bytes
This commit is contained in:
parent
94ef0fd294
commit
afd2135393
@ -1169,8 +1169,8 @@ setup_entry_cb (GtkEntry *entry, setting *set)
|
|||||||
{
|
{
|
||||||
int size;
|
int size;
|
||||||
int pos;
|
int pos;
|
||||||
int len = gtk_entry_get_text_length (entry);
|
|
||||||
unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
|
unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
|
||||||
|
int len = strlen (p);
|
||||||
|
|
||||||
/* need to truncate? */
|
/* need to truncate? */
|
||||||
if (len >= set->extra)
|
if (len >= set->extra)
|
||||||
|
Loading…
Reference in New Issue
Block a user