From 6592db6bb526f0c43b4c7b55859c629709e039b4 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Fri, 4 Jun 2010 16:58:58 +0700 Subject: Get rid of xstrdup when argument is definitely non-NULL Replace xstrdup with strdup when either constant string is being duplicated or argument is guarded by conditionals and obviously can't be NULL Signed-off-by: Mikhail Gusarov Reviewed-by: Alan Coopersmith --- xkb/xkbUtils.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xkb') diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 72dd546d4..3344e5088 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -1761,15 +1761,15 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) if (sdoodad->any.type == XkbTextDoodad) { if (sdoodad->text.text) ddoodad->text.text = - xstrdup(sdoodad->text.text); + strdup(sdoodad->text.text); if (sdoodad->text.font) ddoodad->text.font = - xstrdup(sdoodad->text.font); + strdup(sdoodad->text.font); } else if (sdoodad->any.type == XkbLogoDoodad) { if (sdoodad->logo.logo_name) ddoodad->logo.logo_name = - xstrdup(sdoodad->logo.logo_name); + strdup(sdoodad->logo.logo_name); } } dsection->overlays = NULL; @@ -1832,14 +1832,14 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) memcpy(ddoodad , sdoodad, sizeof(XkbDoodadRec)); if (sdoodad->any.type == XkbTextDoodad) { if (sdoodad->text.text) - ddoodad->text.text = xstrdup(sdoodad->text.text); + ddoodad->text.text = strdup(sdoodad->text.text); if (sdoodad->text.font) - ddoodad->text.font = xstrdup(sdoodad->text.font); + ddoodad->text.font = strdup(sdoodad->text.font); } else if (sdoodad->any.type == XkbLogoDoodad) { if (sdoodad->logo.logo_name) ddoodad->logo.logo_name = - xstrdup(sdoodad->logo.logo_name); + strdup(sdoodad->logo.logo_name); } } -- cgit v1.2.3