Commit 336c1e7a authored by Alan Coopersmith's avatar Alan Coopersmith 🛫

Replace Xmalloc+strcpy pairs with strdup calls

Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 258a8ced
......@@ -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;
......
......@@ -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));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment