[syslinux:master] VPD: Fixing base_address

syslinux-bot for Erwan Velu erwanaliasr1 at gmail.com
Tue May 11 13:57:19 PDT 2010


Commit-ID:  aa1e064d872ea0b14bbbf67277b069b0a2f30d91
Gitweb:     http://syslinux.zytor.com/commit/aa1e064d872ea0b14bbbf67277b069b0a2f30d91
Author:     Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Tue, 11 May 2010 22:52:27 +0200
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Tue, 11 May 2010 22:52:27 +0200

VPD: Fixing base_address

This commit now save properly VPD's address.


---
 com32/gplinclude/vpd/vpd.h |    2 +-
 com32/gpllib/vpd/vpd.c     |    2 +-
 com32/hdt/hdt-cli-vpd.c    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/com32/gplinclude/vpd/vpd.h b/com32/gplinclude/vpd/vpd.h
index f1dcec6..bff77bd 100644
--- a/com32/gplinclude/vpd/vpd.h
+++ b/com32/gplinclude/vpd/vpd.h
@@ -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;
 
diff --git a/com32/gpllib/vpd/vpd.c b/com32/gpllib/vpd/vpd.c
index fd468e4..6507f0d 100644
--- a/com32/gpllib/vpd/vpd.c
+++ b/com32/gpllib/vpd/vpd.c
@@ -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;
 
diff --git a/com32/hdt/hdt-cli-vpd.c b/com32/hdt/hdt-cli-vpd.c
index 4974720..c2f1c4e 100644
--- a/com32/hdt/hdt-cli-vpd.c
+++ b/com32/hdt/hdt-cli-vpd.c
@@ -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);



More information about the Syslinux-commits mailing list