VPD: Fixing base_address
authorErwan Velu <erwanaliasr1@gmail.com>
Tue, 11 May 2010 20:52:27 +0000 (22:52 +0200)
committerErwan Velu <erwanaliasr1@gmail.com>
Tue, 11 May 2010 20:52:27 +0000 (22:52 +0200)
This commit now save properly VPD's address.

com32/gplinclude/vpd/vpd.h
com32/gpllib/vpd/vpd.c
com32/hdt/hdt-cli-vpd.c

index f1dcec6..bff77bd 100644 (file)
@@ -25,7 +25,7 @@ typedef struct {
     char bios_release_date[9];
     char default_flash_filename[13];
     char bios_version[255];
-    char base_address[6];
+    char base_address[16];
     bool filled;
 } s_vpd;
 
index fd468e4..6507f0d 100644 (file)
@@ -64,7 +64,7 @@ int vpd_decode(s_vpd * vpd)
     for (q = p; q < p + 0x10000; q += 4) {
        memcpy(buf, q, 5);
        if (memcmp(buf, "\252\125VPD", 5) == 0) {
-           snprintf(&vpd->base_address, 5, "%X", q);
+           snprintf(vpd->base_address, sizeof(vpd->base_address), "%p", q);
            if (q[5] < 0x30)
                return -ENOVPDTABLE;
 
index 4974720..c2f1c4e 100644 (file)
@@ -43,7 +43,7 @@ void main_show_vpd(int argc __unused, char **argv __unused,
        return;
     }
 
-    more_printf("VPD present at address : 0x%s\n", hardware->vpd.base_address);
+    more_printf("VPD present at address : %s\n", hardware->vpd.base_address);
     if (strlen(hardware->vpd.bios_build_id) > 0)
        more_printf("Bios Build ID                 : %s\n",
                    hardware->vpd.bios_build_id);