bugfix: storagecommands: read fru: return bytes included
The requested number of bytes could exceed the bytes remaining,
therefore only return the length of the bytes returned.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Id1e107b07fc787bf49d0b0455be2e4e10750b798
diff --git a/src/storagecommands.cpp b/src/storagecommands.cpp
index 1d8763c..7b41d8d 100644
--- a/src/storagecommands.cpp
+++ b/src/storagecommands.cpp
@@ -314,7 +314,8 @@
requestedData.begin(), fruCache.begin() + fruInventoryOffset,
fruCache.begin() + fruInventoryOffset + fromFruByteLen);
- return ipmi::responseSuccess(countToRead, requestedData);
+ return ipmi::responseSuccess(static_cast<uint8_t>(requestedData.size()),
+ requestedData);
}
/** @brief implements the write FRU data command