diff options
Diffstat (limited to 'fofi')
-rw-r--r-- | fofi/FoFiIdentifier.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fofi/FoFiIdentifier.cc b/fofi/FoFiIdentifier.cc index 3d41145b..ffe9c47c 100644 --- a/fofi/FoFiIdentifier.cc +++ b/fofi/FoFiIdentifier.cc @@ -378,13 +378,12 @@ GBool StreamReader::getUVarBE(int pos, int size, Guint *val) { } GBool StreamReader::cmp(int pos, const char *s) { - int n; - - n = (int)strlen(s); + const int n = (int)strlen(s); if (!fillBuf(pos, n)) { return gFalse; } - return !memcmp(buf - bufPos + pos, s, n); + const int posDiff = pos - bufPos; + return !memcmp(buf + posDiff, s, n); } GBool StreamReader::fillBuf(int pos, int len) { |