aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/xkb
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/src/xkb')
-rw-r--r--libX11/src/xkb/XKBGAlloc.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libX11/src/xkb/XKBGAlloc.c b/libX11/src/xkb/XKBGAlloc.c
index 832d28530..55505f4f6 100644
--- a/libX11/src/xkb/XKBGAlloc.c
+++ b/libX11/src/xkb/XKBGAlloc.c
@@ -684,9 +684,7 @@ register XkbPropertyPtr prop;
if ((prop->name)&&(strcmp(name,prop->name)==0)) {
if (prop->value)
_XkbFree(prop->value);
- prop->value= (char *)_XkbAlloc(strlen(value)+1);
- if (prop->value)
- strcpy(prop->value,value);
+ prop->value= strdup(value);
return prop;
}
}
@@ -695,17 +693,15 @@ register XkbPropertyPtr prop;
return NULL;
}
prop= &geom->properties[geom->num_properties];
- prop->name= (char *)_XkbAlloc(strlen(name)+1);
+ prop->name= strdup(name);
if (!prop->name)
return NULL;
- strcpy(prop->name,name);
- prop->value= (char *)_XkbAlloc(strlen(value)+1);
+ prop->value= strdup(value);
if (!prop->value) {
_XkbFree(prop->name);
prop->name= NULL;
return NULL;
}
- strcpy(prop->value,value);
geom->num_properties++;
return prop;
}
@@ -757,10 +753,9 @@ register XkbColorPtr color;
}
color= &geom->colors[geom->num_colors];
color->pixel= pixel;
- color->spec= (char *)_XkbAlloc(strlen(spec)+1);
+ color->spec= strdup(spec);
if (!color->spec)
return NULL;
- strcpy(color->spec,spec);
geom->num_colors++;
return color;
}