diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-04-12 22:30:45 -0700 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:25 +0200 |
commit | dde00b2f6848a38e9fdbe1e4c85373c8b12944b4 (patch) | |
tree | 070849ce4d0d19b3bb5c17ddf308023147357e7b /nx-X11/lib/X11/XDefaultIMIF.c | |
parent | 7d7224d8543e85e3a34a1cddf99f3eac9aa9050b (diff) | |
download | nx-libs-dde00b2f6848a38e9fdbe1e4c85373c8b12944b4.tar.gz nx-libs-dde00b2f6848a38e9fdbe1e4c85373c8b12944b4.tar.bz2 nx-libs-dde00b2f6848a38e9fdbe1e4c85373c8b12944b4.zip |
Convert malloc(strlen()); strcpy() sets to strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/XDefaultIMIF.c')
-rw-r--r-- | nx-X11/lib/X11/XDefaultIMIF.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nx-X11/lib/X11/XDefaultIMIF.c b/nx-X11/lib/X11/XDefaultIMIF.c index d36962f05..135c5a259 100644 --- a/nx-X11/lib/X11/XDefaultIMIF.c +++ b/nx-X11/lib/X11/XDefaultIMIF.c @@ -226,12 +226,10 @@ _XDefaultOpenIM( local_impart->ctow_conv = ctow_conv; if ((res_name != NULL) && (*res_name != '\0')){ - im->core.res_name = (char *)Xmalloc(strlen(res_name)+1); - strcpy(im->core.res_name,res_name); + im->core.res_name = strdup(res_name); } if ((res_class != NULL) && (*res_class != '\0')){ - im->core.res_class = (char *)Xmalloc(strlen(res_class)+1); - strcpy(im->core.res_class,res_class); + im->core.res_class = strdup(res_class); } return (XIM)im; |