diff --git a/cpp/QrCode.cpp b/cpp/QrCode.cpp index 60cfd67..90a3989 100644 --- a/cpp/QrCode.cpp +++ b/cpp/QrCode.cpp @@ -310,7 +310,7 @@ QrCode QrCode::encodeSegments(const vector &segs, Ecc ecl, // Pack bits into bytes in big endian vector dataCodewords(bb.size() / 8); for (size_t i = 0; i < bb.size(); i++) - dataCodewords[i >> 3] |= (bb.at(i) ? 1 : 0) << (7 - (i & 7)); + dataCodewords.at(i >> 3) |= (bb.at(i) ? 1 : 0) << (7 - (i & 7)); // Create the QR Code object return QrCode(version, ecl, dataCodewords, mask);