From d1d404fef4a87539b8810c3a67c0b1959e506c3e Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Mon, 22 Apr 2013 10:31:50 +0000 Subject: [PATCH] ID: 3608765 - Fix signed offset in ipmi_ekanalyzer_fru_file2structure If the offset was greater than 127, then the multi_offset would end up being a negative value, which is not what we want. Commit for Dan Gora --- ipmitool/lib/ipmi_ekanalyzer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ipmitool/lib/ipmi_ekanalyzer.c b/ipmitool/lib/ipmi_ekanalyzer.c index a82e4c8..53f94f2 100644 --- a/ipmitool/lib/ipmi_ekanalyzer.c +++ b/ipmitool/lib/ipmi_ekanalyzer.c @@ -3964,9 +3964,9 @@ ipmi_ekanalyzer_fru_file2structure(char * filename, struct ipmi_ek_multi_header ** list_last) { FILE * input_file; - char data; + unsigned char data; unsigned char last_record = 0; - int multi_offset = 0; + unsigned int multi_offset = 0; int record_count = 0; input_file = fopen(filename, "r"); @@ -4012,9 +4012,10 @@ ipmi_ekanalyzer_fru_file2structure(char * filename, } if (verbose > 1) { int i; - printf("%02x\t", (*list_record)->header.type); + printf("Type: %02x\t", (*list_record)->header.type); for (i = 0; i < ((*list_record)->header.len); i++) { - printf("%02x\t", (*list_record)->data[i]); + printf("0x%04x: %02x\t", + i, (*list_record)->data[i]); } printf("\n"); }