diff --git a/src/map/ENC/iso8211.cpp b/src/map/ENC/iso8211.cpp index 5ee607de..1cbd462f 100644 --- a/src/map/ENC/iso8211.cpp +++ b/src/map/ENC/iso8211.cpp @@ -91,15 +91,16 @@ bool ISO8211::readDDA(const FieldDefinition &def, SubFields &fields) { static const QRegularExpression re( "([0-9]*)(A|I|R|B|b11|b12|b14|b21|b22|b24)\\(*([0-9]*)\\)*"); - QByteArray ba(def.size, Qt::Initialization::Uninitialized); + char buffer[def.size]; bool repeat = false; QVector defs; QVector defTags; - if (!(_file.seek(def.pos) && _file.read(ba.data(), ba.size()) == ba.size())) + if (!(_file.seek(def.pos) && _file.read(buffer, def.size) == def.size)) return false; - QList list(ba.split('\x1f')); + QList list(QByteArray::fromRawData(buffer, def.size) + .split('\x1f')); if (!list.at(1).isEmpty() && list.at(1).front() == '*') { repeat = true; list[1].remove(0, 1); @@ -192,15 +193,14 @@ bool ISO8211::readDDR() bool ISO8211::readUDA(quint64 pos, const FieldDefinition &def, const QVector &fields, bool repeat, Data &data) { - QByteArray ba(def.size, Qt::Initialization::Uninitialized); + char ba[def.size]; - if (!(_file.seek(pos + def.pos) - && _file.read(ba.data(), ba.size()) == ba.size())) + if (!(_file.seek(pos + def.pos) && _file.read(ba, def.size) == def.size)) return false; const char *sp; - const char *dp = ba.constData(); - const char *ep = ba.constData() + ba.size() - 1; + const char *dp = ba; + const char *ep = ba + def.size - 1; do { QVector row(fields.size());