Fix: GetSdr nextRecord can not reach lastRecord
The output of `ipmitool sdr elist` is missing the last
fru message because nextRecord can not reach lastRecord
Tested: `ipmitool sdr elist' works as expected
Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: I2862166e5ab161cee33a59857749d13823e13cbf
diff --git a/src/sensorcommands.cpp b/src/sensorcommands.cpp
index cdee840..85238ef 100644
--- a/src/sensorcommands.cpp
+++ b/src/sensorcommands.cpp
@@ -931,7 +931,7 @@
}
uint16_t nextRecord =
- lastRecord > (req->recordID + 1) ? req->recordID + 1 : 0XFFFF;
+ lastRecord > req->recordID ? req->recordID + 1 : 0XFFFF;
auto responseClear = static_cast<uint8_t *>(response);
std::fill(responseClear, responseClear + requestedSize, 0);