summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2010-11-27 23:49:55 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-11-30 16:25:10 -0800
commit2c8e534c8e9334562485aeaaef374871cf14d5fe (patch)
tree4ef61dc2f83ff63b79ee95afa0eefa3c78c063db
parent29e467a1f1548a826ee2793244e3ff416aa1a0f2 (diff)
xf86ValidateModes: xnfalloc(strlen) + strcpy => xnfstrdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Julien Cristau <jcristau@debian.org>
-rw-r--r--hw/xfree86/common/xf86Mode.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index 54fe0210d..644e5ce80 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1643,8 +1643,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
new = xnfcalloc(1, sizeof(DisplayModeRec));
new->prev = last;
new->type = M_T_USERDEF;
- new->name = xnfalloc(strlen(modeNames[i]) + 1);
- strcpy(new->name, modeNames[i]);
+ new->name = xnfstrdup(modeNames[i]);
if (new->prev)
new->prev->next = new;
*endp = last = new;
@@ -1716,10 +1715,9 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
p = xnfcalloc(1, sizeof(DisplayModeRec));
p->prev = last;
- p->name = xnfalloc(strlen(r->name) + 1);
+ p->name = xnfstrdup(r->name);
if (!userModes)
p->type = M_T_USERDEF;
- strcpy(p->name, r->name);
if (p->prev)
p->prev->next = p;
*endp = last = p;