diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-17 11:34:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-17 11:34:43 -0700 |
commit | 75a5110558714d5f601235fdc5762aeef731f73d (patch) | |
tree | f2a8530a30ba4734020a08ad6903b1c5e5c587f8 | |
parent | f5eb468f0ca87917488bdd8bdecf9e31fce88945 (diff) |
Minor code cleanups (remove unused static and opencoding of strdup)
-rw-r--r-- | setxkbmap.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/setxkbmap.c b/setxkbmap.c index 83083eb..c46369a 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -101,7 +101,6 @@ char * svName[NUM_STRING_VALS]= { int svSrc[NUM_STRING_VALS]; char * svValue[NUM_STRING_VALS]; -XkbConfigFieldsRec cfgDflts; XkbConfigRtrnRec cfgResult; XkbRF_RulesPtr rules= NULL; @@ -532,9 +531,8 @@ addStringToOptions(char *opt_str,int *sz_opts,int *num_opts,char ***opts) char *tmp,*str,*next; Bool ok= True; - if ((str= malloc(strlen(opt_str)+1))!=NULL) - strcpy(str,opt_str); - else return False; + if ((str = strdup(opt_str)) == NULL) + return False; for (tmp= str,next=NULL;(tmp && *tmp!='\0')&&ok;tmp=next) { next= strchr(str,','); if (next) { |