aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-29 14:38:43 +0100
committerErwan Velu <erwan.velu@free.fr>2009-12-04 10:11:15 +0100
commitadbc06e2c0d4e65b13492a80a6ebc0f3c855cfba (patch)
tree2ddd8d56461b5eb80042e2b4b658e5dbd4c08d15 /com32
parentc08eba77232a2c69c4312c203ddf86330d2214a1 (diff)
downloadsyslinux.git-adbc06e2c0d4e65b13492a80a6ebc0f3c855cfba.tar.gz
syslinux.git-adbc06e2c0d4e65b13492a80a6ebc0f3c855cfba.tar.xz
syslinux.git-adbc06e2c0d4e65b13492a80a6ebc0f3c855cfba.zip
hdt: Do not display hostbus & interface for EDD<3
Impact: Avoid corruption while displaying host bus interface when EDD<3.0 If EDD < 3.0 displaying host bus & interface for disk devices return unexpected content. We have to avoid displaying that informations in such case
Diffstat (limited to 'com32')
-rw-r--r--com32/hdt/hdt-cli-disk.c9
-rw-r--r--com32/hdt/hdt-menu-disk.c25
2 files changed, 21 insertions, 13 deletions
diff --git a/com32/hdt/hdt-cli-disk.c b/com32/hdt/hdt-cli-disk.c
index cabee9de..a766ab83 100644
--- a/com32/hdt/hdt-cli-disk.c
+++ b/com32/hdt/hdt-cli-disk.c
@@ -212,9 +212,12 @@ void disks_summary(int argc __unused, char **argv __unused,
d->legacy_sectors_per_track);
more_printf(" EDD: Version: %X, size: %s\n", d->edd_version,
disk_size);
- more_printf(" Host bus: %s, Interface type: %s\n\n",
- remove_spaces((char *)d->edd_params.host_bus_type),
- remove_spaces((char *)d->edd_params.interface_type));
+
+ /* Do not print Host Bus & Interface if EDD isn't 3.0 or more */
+ if (d->edd_version >= 30)
+ more_printf(" Host bus: %s, Interface type: %s\n\n",
+ remove_spaces((char *)d->edd_params.host_bus_type),
+ remove_spaces((char *)d->edd_params.interface_type));
}
if (found == false)
diff --git a/com32/hdt/hdt-menu-disk.c b/com32/hdt/hdt-menu-disk.c
index f0455004..83eb379b 100644
--- a/com32/hdt/hdt-menu-disk.c
+++ b/com32/hdt/hdt-menu-disk.c
@@ -173,20 +173,25 @@ static int compute_disk_module(struct s_my_menu *menu, int nb_sub_disk_menu,
sectors_to_size_dec2(d[disk_number].edd_params.sectors, size_dec);
snprintf(buffer, sizeof buffer, "Size : %s/%s (%d %s)",
- remove_spaces(size_iec), remove_spaces(size_dec), previous_size, previous_unit);
+ remove_spaces(size_iec), remove_spaces(size_dec), previous_size,
+ previous_unit);
snprintf(statbuffer, sizeof statbuffer, "Size: %s/%s (%d %s)",
- remove_spaces(size_iec), remove_spaces(size_dec), previous_size, previous_unit);
+ remove_spaces(size_iec), remove_spaces(size_dec), previous_size,
+ previous_unit);
add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
menu[nb_sub_disk_menu].items_count++;
- snprintf(buffer, sizeof buffer, "Host Bus/Interface: %s / %s",
- remove_spaces((char *)d[disk_number].edd_params.host_bus_type),
- d[disk_number].edd_params.interface_type);
- snprintf(statbuffer, sizeof statbuffer, "Host Bus / Interface: %s / %s",
- remove_spaces((char *)d[disk_number].edd_params.host_bus_type),
- d[disk_number].edd_params.interface_type);
- add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
- menu[nb_sub_disk_menu].items_count++;
+ /* Do not print Host Bus & Interface if EDD isn't 3.0 or more */
+ if (d[disk_number].edd_version >= 30) {
+ snprintf(buffer, sizeof buffer, "Host Bus/Interface: %s / %s",
+ remove_spaces((char *)d[disk_number].edd_params.host_bus_type),
+ d[disk_number].edd_params.interface_type);
+ snprintf(statbuffer, sizeof statbuffer, "Host Bus / Interface: %s / %s",
+ remove_spaces((char *)d[disk_number].edd_params.host_bus_type),
+ d[disk_number].edd_params.interface_type);
+ add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
+ menu[nb_sub_disk_menu].items_count++;
+ }
snprintf(buffer, sizeof buffer, "C / H / S : %d / %d / %d",
d[disk_number].legacy_max_cylinder + 1,