diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-03-17 18:38:58 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-03-17 18:38:58 -0700 |
commit | 27a2e16e8ea11c1604e28645fae4d6ba4371d513 (patch) | |
tree | 503c5239945e2f349df0faf5e28cafc99ef4c98a | |
parent | 78a894231ae8ec4959007b6d9b8d2a15d6333a1e (diff) | |
download | xorg-lib-libX11-27a2e16e8ea11c1604e28645fae4d6ba4371d513.tar.gz |
makekeys: combine malloc(strlen)+strcpy into strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | src/util/makekeys.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/util/makekeys.c b/src/util/makekeys.c index 20266f18..3fe8a96e 100644 --- a/src/util/makekeys.c +++ b/src/util/makekeys.c @@ -100,12 +100,11 @@ main(int argc, char *argv[]) key); continue; } - name = malloc((unsigned)strlen(key)+1); + name = strdup(key); if (!name) { fprintf(stderr, "makekeys: out of memory!\n"); exit(1); } - (void)strcpy(name, key); info[ksnum].name = name; ksnum++; if (ksnum == KTNUM) { |