diff --git a/modules/im/ximcp/imDefIm.c b/modules/im/ximcp/imDefIm.c index 9e877c0b..970df0cf 100644 --- a/modules/im/ximcp/imDefIm.c +++ b/modules/im/ximcp/imDefIm.c @@ -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; diff --git a/src/GetAtomNm.c b/src/GetAtomNm.c index d7f06e36..97bebaf4 100644 --- a/src/GetAtomNm.c +++ b/src/GetAtomNm.c @@ -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)); } } }