summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-06 20:07:40 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-06 20:07:40 -0800
commit2785ef0c967571977b78490eb501c5f9da91d48c (patch)
tree6e253472038ffb4d8015970400b0762380686916
parent05c9c12b6491708bc9ed9ea6b7a5321928d5ac93 (diff)
Replace malloc(strlen) + strcpy() with strdup()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xwud.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/xwud.c b/xwud.c
index 0625f3a..9c6808c 100644
--- a/xwud.c
+++ b/xwud.c
@@ -376,9 +376,7 @@ main(int argc, char *argv[])
mask = VisualScreenMask;
if (vis)
{
- char *vt;
- vt = malloc(strlen(vis) + 1);
- strcpy(vt, vis);
+ char *vt = strdup(vis);
Latin1Upper(vt);
if (strcmp(vt, "STATICGRAY") == 0) {
vinfo.class = StaticGray;