Author: blueswirl Date: 2009-07-12 10:15:38 +0200 (Sun, 12 Jul 2009) New Revision: 509
Modified: trunk/openbios-devel/drivers/ide.c trunk/openbios-devel/drivers/ide.h Log: Handle ide model name string (Igor Kovalenko)
This handles fixed-size ide model name string without trailing zero.
Modified: trunk/openbios-devel/drivers/ide.c =================================================================== --- trunk/openbios-devel/drivers/ide.c 2009-07-11 12:25:26 UTC (rev 508) +++ trunk/openbios-devel/drivers/ide.c 2009-07-12 08:15:38 UTC (rev 509) @@ -980,7 +980,8 @@ drive->sect = id.sectors; }
- strcpy(drive->model, (char *)id.model); + strncpy(drive->model, (char*)id.model, sizeof(id.model)); + drive->model[40] = '\0'; return 0; }
Modified: trunk/openbios-devel/drivers/ide.h =================================================================== --- trunk/openbios-devel/drivers/ide.h 2009-07-11 12:25:26 UTC (rev 508) +++ trunk/openbios-devel/drivers/ide.h 2009-07-12 08:15:38 UTC (rev 509) @@ -146,7 +146,7 @@ char media; /* disk, cdrom, etc */ char addressing; /* chs/lba28/lba48 */
- char model[40]; /* name */ + char model[41]; /* name */ int nr;
unsigned long sectors;