Fix _e_wid_text_change

SVN revision: 17994
This commit is contained in:
sebastid 2005-10-26 20:41:06 +00:00 committed by sebastid
parent b9c35a74b1
commit d3e74a5a07
1 changed files with 4 additions and 8 deletions

View File

@ -118,23 +118,19 @@ _e_wid_text_change(void *data, Evas_Object *entry, char *key)
wd = data; wd = data;
if(*(wd->valptr) == NULL) if (*(wd->valptr) == NULL)
{ {
size = (strlen(key) + 1) * sizeof(char); size = (strlen(key) + 1) * sizeof(char);
*(wd->valptr) = realloc(*(wd->valptr), size); *(wd->valptr) = malloc(size);
snprintf(*(wd->valptr), size, "%s", key); snprintf(*(wd->valptr), size, "%s", key);
} }
else else
{ {
char *tmp;
size = (strlen(*(wd->valptr)) + strlen(key) + 1) * sizeof(char); size = (strlen(*(wd->valptr)) + strlen(key) + 1) * sizeof(char);
tmp = E_NEW(char *, strlen(*(wd->valptr)) + 1);
snprintf(tmp, strlen(*(wd->valptr)) + 1, "%s", *(wd->valptr));
*(wd->valptr) = realloc(*(wd->valptr), size); *(wd->valptr) = realloc(*(wd->valptr), size);
snprintf(*(wd->valptr), size, "%s%s\0", tmp, key); strcat(*(wd->valptr), key);
E_FREE(tmp);
} }
return 1;
} }
/* externally accessible functions */ /* externally accessible functions */