aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/Item.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/Item.c b/generic/Item.c
index 494e069..b2b6a6a 100644
--- a/generic/Item.c
+++ b/generic/Item.c
@@ -448,11 +448,13 @@ ZnConfigureAttributes(WidgetInfo *wi,
case ZN_CONFIG_STRING:
case ZN_CONFIG_MAP_INFO:
{
- char *text = "";
+ char *text = NULL;
str = Tcl_GetString(args[i+1]);
if (!*((char **) valp) || strcmp(str, *((char **) valp)) != 0) {
- text = (char *) ZnMalloc(strlen(str)+1);
- strcpy(text, str);
+ if (strlen(str)) {
+ text = (char *) ZnMalloc(strlen(str)+1);
+ strcpy(text, str);
+ }
if (*((char **) valp)) {
ZnFree(*((char **) valp));
}