hdt: Fixing output of vesa software revision
authorErwan Velu <erwan.velu@free.fr>
Wed, 25 Mar 2009 17:51:48 +0000 (18:51 +0100)
committerErwan Velu <erwan.velu@free.fr>
Thu, 26 Mar 2009 17:28:22 +0000 (18:28 +0100)
Impact: Vesa's software revision was misdisplayed and could lead to
corruption

Displaying an int with %s isn't a good idea ;o)

com32/hdt/hdt-cli-vesa.c
com32/hdt/hdt-menu-vesa.c

index e6843ee..db7642d 100644 (file)
@@ -44,7 +44,7 @@ void main_show_vesa(struct s_hardware *hardware) {
   more_printf(" Vendor       : %s\n",hardware->vesa.vendor);
   more_printf(" Product      : %s\n",hardware->vesa.product);
   more_printf(" Product rev. : %s\n",hardware->vesa.product_revision);
-  more_printf(" Software rev.: %s\n",hardware->vesa.software_rev);
+  more_printf(" Software rev.: %d\n",hardware->vesa.software_rev);
   more_printf(" Memory (KB)  : %d\n",hardware->vesa.total_memory*64);
   more_printf(" Modes        : %d\n",hardware->vesa.vmi_count);
 }
index 345d74b..2d807aa 100644 (file)
@@ -58,8 +58,8 @@ static void compute_vesa_card(struct s_my_menu *menu, struct s_hardware *hardwar
    add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
    menu->items_count++;
 
-   snprintf(buffer,sizeof buffer,"Software Rev: %s",hardware->vesa.software_rev);
-   snprintf(statbuffer,sizeof statbuffer,"Software Revision: %s",hardware->vesa.software_rev);
+   snprintf(buffer,sizeof buffer,"Software Rev: %d",hardware->vesa.software_rev);
+   snprintf(statbuffer,sizeof statbuffer,"Software Revision: %d",hardware->vesa.software_rev);
    add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
    menu->items_count++;