summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhali <khali>2010-11-18 12:44:01 +0000
committerkhali <khali>2010-11-18 12:44:01 +0000
commit056c32af9b74669abd277ef504088936a30e9882 (patch)
tree2d15eeffaeb63d719a1fb9d736129a5a1a9f1e48
parent8a2704067878feea63e0e5bfca6c59ce5e34c894 (diff)
downloaddmidecode-056c32af9b74669abd277ef504088936a30e9882.tar.gz
Fix length condition when decoding battery capacity. Probably not a big
deal in practice, but there's no point in checking beyond our needs.
-rw-r--r--dmidecode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dmidecode.c b/dmidecode.c
index 63eafe8..55f1449 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -3549,7 +3549,7 @@ static void dmi_decode(const struct dmi_header *h, u16 ver)
printf("\tChemistry: %s\n",
dmi_battery_chemistry(data[0x09]));
printf("\tDesign Capacity:");
- if (h->length < 0x1A)
+ if (h->length < 0x16)
dmi_battery_capacity(WORD(data + 0x0A), 1);
else
dmi_battery_capacity(WORD(data + 0x0A), data[0x15]);