summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2007-01-27 12:29:31 -0800
committerKeith Packard <keithp@guitar.keithp.com>2007-01-27 12:29:31 -0800
commit00decd3b6cea0de22c88b9504dbe26d680e8ab16 (patch)
treee882c9e2e7ecca7bbe57cf4d7f0cea001e061469
parent7a5f17087bda2833e84fa7e7ff0cb168943b89b6 (diff)
Don't zero out mode structure after setting name field.
Instead of using memset to zero the structure (at the wrong time, no less), use xcalloc to gather pre-initialized memory.
-rw-r--r--src/i830_xf86Modes.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/i830_xf86Modes.c b/src/i830_xf86Modes.c
index f37eaeb7..b5f06d6c 100644
--- a/src/i830_xf86Modes.c
+++ b/src/i830_xf86Modes.c
@@ -564,7 +564,7 @@ xf86GetConfigModes (XF86ConfModeLinePtr conf_mode)
for (; conf_mode; conf_mode = (XF86ConfModeLinePtr) conf_mode->list.next)
{
- mode = xalloc(sizeof(DisplayModeRec));
+ mode = xcalloc(1, sizeof(DisplayModeRec));
if (!mode)
continue;
mode->name = xstrdup(conf_mode->ml_identifier);
@@ -573,8 +573,6 @@ xf86GetConfigModes (XF86ConfModeLinePtr conf_mode)
xfree (mode);
continue;
}
-
- memset(mode,'\0',sizeof(DisplayModeRec));
mode->type = 0;
mode->Clock = conf_mode->ml_clock;
mode->HDisplay = conf_mode->ml_hdisplay;