Commit 6ba77c36 authored by Volker Krause's avatar Volker Krause
Browse files

Silence warning messages on 0-length RCT2 field reads

0-length fields make no sense, but are nevertheless common in ÖBB tickets.
parent 6fda5783
......@@ -37,6 +37,10 @@ int Uic9183Utils::readAsciiEncodedNumber(const Uic9183Block &block, int offset,
QString Uic9183Utils::readUtf8String(const char* data, int size, int offset, int length)
{
if (length == 0) { // common in ÖBB RCT2 blocks...
return {};
}
if (!data || offset < 0 || length < 1 || size < 1 || offset + length > size) {
qCWarning(Log) << "Invalid UIC 918.3 read" << offset << length << size;
return {};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment