Fix iteration

This commit is contained in:
Brad Davis 2017-03-07 18:13:05 -08:00
parent 399270d243
commit 9b8a531439

View file

@ -101,7 +101,7 @@ namespace ktx {
// find the first null character \0 and extract the key
uint32_t keyLength = 0;
while (reinterpret_cast<const char*>(keyValueBytes[++keyLength]) != '\0') {
while (reinterpret_cast<const char*>(keyValueBytes)[++keyLength] != '\0') {
if (keyLength == keyAndValueByteSize) {
// key must be null-terminated, and there must be space for the value
throw ReaderException("invalid key-value " + std::string(reinterpret_cast<const char*>(keyValueBytes), keyLength));