Replace Xmalloc+strcpy pairs with strdup calls

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Alan Coopersmith 2015-09-26 11:12:47 -07:00
parent 258a8ced68
commit 336c1e7a50
2 changed files with 2 additions and 7 deletions

View file

@ -330,9 +330,7 @@ _XimPreConnectionIM(
else
goto Error;
}
if( (locale_name[3] = Xmalloc(llen+1)) != NULL )
strcpy( locale_name[3], language );
else
if( (locale_name[3] = strdup(language)) == NULL )
goto Error;
if((locales = XInternAtom(display, XIM_LOCALES, True)) == (Atom)None)
goto Error;

View file

@ -45,10 +45,7 @@ char *_XGetAtomName(
table = dpy->atoms->table;
for (idx = TABLESIZE; --idx >= 0; ) {
if ((e = *table++) && (e->atom == atom)) {
idx = strlen(EntryName(e)) + 1;
if ((name = Xmalloc(idx)))
strcpy(name, EntryName(e));
return name;
return strdup(EntryName(e));
}
}
}