diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-02-13 21:36:03 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-15 10:35:41 +1000 |
commit | aac1b435664819008989ed19f73e9c89920602c5 (patch) | |
tree | da97dfec6fe635ec8cd609ee03ad247a07b3e499 /xkb/xkbfmisc.c | |
parent | a4a2e814d5d0e6152307a301eda1d6fc1c555aaa (diff) |
Replace _XkbDupString with Xstrdup
The two functions have identical semantics, including safely returning
NULL when NULL is passed in (which POSIX strdup does not guarantee).
Some callers could probably be adjusted to call libc strdup directly,
when we know the input is non-NULL.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'xkb/xkbfmisc.c')
-rw-r--r-- | xkb/xkbfmisc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/xkb/xkbfmisc.c b/xkb/xkbfmisc.c index 7aa9863f2..dea347335 100644 --- a/xkb/xkbfmisc.c +++ b/xkb/xkbfmisc.c @@ -241,7 +241,7 @@ unsigned wantNames,wantConfig,wantDflts; if (wantNames&XkmTypesMask) { if (old_names->types!=None) { tmp= NameForAtom(old_names->types); - names->types= _XkbDupString(tmp); + names->types= Xstrdup(tmp); } else { wantDflts|= XkmTypesMask; @@ -251,7 +251,7 @@ unsigned wantNames,wantConfig,wantDflts; if (wantNames&XkmCompatMapMask) { if (old_names->compat!=None) { tmp= NameForAtom(old_names->compat); - names->compat= _XkbDupString(tmp); + names->compat= Xstrdup(tmp); } else wantDflts|= XkmCompatMapMask; complete|= XkmCompatMapMask; @@ -260,13 +260,13 @@ unsigned wantNames,wantConfig,wantDflts; if (old_names->symbols==None) return FALSE; tmp= NameForAtom(old_names->symbols); - names->symbols= _XkbDupString(tmp); + names->symbols= Xstrdup(tmp); complete|= XkmSymbolsMask; } if (wantNames&XkmKeyNamesMask) { if (old_names->keycodes!=None) { tmp= NameForAtom(old_names->keycodes); - names->keycodes= _XkbDupString(tmp); + names->keycodes= Xstrdup(tmp); } else wantDflts|= XkmKeyNamesMask; complete|= XkmKeyNamesMask; @@ -275,7 +275,7 @@ unsigned wantNames,wantConfig,wantDflts; if (old_names->geometry==None) return FALSE; tmp= NameForAtom(old_names->geometry); - names->geometry= _XkbDupString(tmp); + names->geometry= Xstrdup(tmp); complete|= XkmGeometryMask; wantNames&= ~XkmGeometryMask; } |