Commit b4eb33f0 authored by Volker Krause's avatar Volker Krause
Browse files

Strip trailing null bytes in fixed-width UIC 918.3 string fields

parent 73e4195d
......@@ -8,6 +8,8 @@
#include "uic9183block.h"
#include "logging.h"
#include <string.h>
using namespace KItinerary;
int Uic9183Utils::readAsciiEncodedNumber(const char* data, int size, int offset, int length)
......@@ -46,7 +48,7 @@ QString Uic9183Utils::readUtf8String(const char* data, int size, int offset, int
return {};
return QString::fromUtf8(data + offset, length);
return QString::fromUtf8(data + offset, strnlen(data + offset, length));
QString Uic9183Utils::readUtf8String(const QByteArray& data, int offset, int length)
Supports Markdown
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