diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-09-26 11:12:47 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2018-12-08 10:06:42 -0800 |
commit | 336c1e7a505698a8f3bcb6eb96dbbb8ed21ade96 (patch) | |
tree | c2a5af583241115b81004484cabc16ad86f078f2 | |
parent | 258a8ced681dc1bc50396be7439fce23f9807e2a (diff) | |
download | xorg-lib-libX11-336c1e7a505698a8f3bcb6eb96dbbb8ed21ade96.tar.gz |
Replace Xmalloc+strcpy pairs with strdup calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | modules/im/ximcp/imDefIm.c | 4 | ||||
-rw-r--r-- | src/GetAtomNm.c | 5 |
2 files changed, 2 insertions, 7 deletions
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)); } } } |