summaryrefslogtreecommitdiff
path: root/src/gram.y
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-18 10:50:01 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-18 10:50:01 -0700
commit97b55a970dc5281c2d41500990d99fcd24d2dd5f (patch)
tree8fe27f9eb52684eefd17d819ccc82ab5500abce2 /src/gram.y
parent8b2a314c267071656ca4d86bae56c6d82bb8127a (diff)
Replace malloc(strlen()+1); strcpy(); pairs with strdup()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/gram.y')
-rw-r--r--src/gram.y3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gram.y b/src/gram.y
index 5f85327..ca40d1c 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -652,8 +652,7 @@ button : BUTTON number { $$ = $2;
}
;
-string : STRING { ptr = malloc(strlen($1)+1);
- strcpy(ptr, $1);
+string : STRING { ptr = strdup($1);
RemoveDQuote(ptr);
$$ = ptr;
}