1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

pcie: use scanff instead of istringstream

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2023-01-12 18:17:55 +01:00 committed by Steffen Vogel
parent 6646308d14
commit 4ff1b159dd

View file

@ -378,7 +378,8 @@ uint32_t Device::readHostBar(unsigned barNum) const
throw RuntimeError("Failed to read resource file");
unsigned long long start, end, flags;
std::istringstream(line) >> std::hex >> start >> end >> flags;
if (std::sscanf(line.c_str(), "%llx %llx %llx", &start, &end, &flags) != 3)
throw SystemError("Failed to parse BAR line");
if (end > start)
throw SystemError("Invalid BAR: start={}, end={}", start, end);