Clean up tv mode name allocation and copy.

TV mode names used to contain the signalling standard along with the pixel
size. The signalling has been moved to the TV_FORMAT property, but the
allocation and initialization of the mode name was left a bit messy as a
result.
This commit is contained in:
Keith Packard 2007-08-10 14:31:16 -07:00
parent f71b9358b4
commit ed1b106fab
1 changed files with 2 additions and 4 deletions

View File

@ -1415,10 +1415,8 @@ i830_tv_get_modes(xf86OutputPtr output)
continue;
mode_ptr = xnfcalloc(1, sizeof(DisplayModeRec));
mode_ptr->name = xnfalloc(strlen(tv_mode->name) +
strlen(input->name) + 4);
sprintf(mode_ptr->name, "%s", input->name);
mode_ptr->name = xnfalloc(strlen(input->name) + 1);
strcpy (mode_ptr->name, input->name);
mode_ptr->HDisplay = hactive_s;
mode_ptr->HSyncStart = hactive_s + 1;