diff options
Diffstat (limited to 'nx-X11/lib/X11/XKBGAlloc.c')
-rw-r--r-- | nx-X11/lib/X11/XKBGAlloc.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/nx-X11/lib/X11/XKBGAlloc.c b/nx-X11/lib/X11/XKBGAlloc.c index 489d41b78..fa405fb9c 100644 --- a/nx-X11/lib/X11/XKBGAlloc.c +++ b/nx-X11/lib/X11/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; } |