From 27a2e16e8ea11c1604e28645fae4d6ba4371d513 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 17 Mar 2009 18:38:58 -0700 Subject: makekeys: combine malloc(strlen)+strcpy into strdup Signed-off-by: Alan Coopersmith --- src/util/makekeys.c | 3 +-- 1 file changed, 1 insertion(+), 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) { -- cgit v1.2.1