mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-08 17:19:01 +02:00
Replace Xmalloc+strcpy pairs with strdup calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
parent
258a8ced68
commit
336c1e7a50
2 changed files with 2 additions and 7 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue