Fixed off-by-one in assert condition: %0 is not a valid format string placeholder.

Part 3 of hotfix for assert caused by percent character in vatsim-data.txt
This commit is contained in:
Mat Sutcliffe
2019-08-31 14:12:24 +01:00
parent b2bfbabb18
commit 25eb13a83f

View File

@@ -50,7 +50,7 @@ namespace BlackMisc
int n = it->unicode() - u'0';
BLACK_VERIFY(n >= 0 && n <= 9);
if (++it != format.end() && is09(*it)) { n = n * 10 + it->unicode() - u'0'; ++it; }
BLACK_VERIFY(n >= 0 && n <= 99);
BLACK_VERIFY(n > 0 && n <= 99);
if (n > 0 && n <= args.size()) { temp += args[n - 1]; unusedArgs &= ~(1ULL << (n - 1)); }
else { temp += u'%' % QString::number(n); }
}