diff options
author | Krzysztof Halasa <khc@pm.waw.pl> | 2007-01-27 12:29:31 -0800 |
---|---|---|
committer | Keith Packard <keithp@guitar.keithp.com> | 2007-01-27 12:29:31 -0800 |
commit | 00decd3b6cea0de22c88b9504dbe26d680e8ab16 (patch) | |
tree | e882c9e2e7ecca7bbe57cf4d7f0cea001e061469 | |
parent | 7a5f17087bda2833e84fa7e7ff0cb168943b89b6 (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.c | 4 |
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; |