diff options
Diffstat (limited to 'src/maildir-readcache.cc')
-rw-r--r-- | src/maildir-readcache.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/maildir-readcache.cc b/src/maildir-readcache.cc index 5864ff6..de51988 100644 --- a/src/maildir-readcache.cc +++ b/src/maildir-readcache.cc @@ -48,7 +48,8 @@ Maildir::ReadCacheResult Maildir::readCache(void) unsigned int readUidValidity; unsigned int readUidNext; - if (sscanf(inputBuffer, "%s %u %u", cacheFileVersionBuffer, &readUidValidity, &readUidNext) != 3 + if (sscanf(inputBuffer, "%s %u %u", cacheFileVersionBuffer, &readUidValidity, &readUidNext) + != 3 || strcmp(cacheFileVersionBuffer, BINC_CACHE) != 0) { // bump cache @@ -71,7 +72,9 @@ Maildir::ReadCacheResult Maildir::readCache(void) while (fgets(inputBuffer, sizeof(inputBuffer), fp)) { inputBuffer[sizeof(inputBuffer) - 1] = '\0'; - if (sscanf(inputBuffer, "%u %u %u %s", &readUID, &readInternalDate, &readSize, readUnique) != 4) { + if (sscanf(inputBuffer, "%u %u %u %s", &readUID, &readInternalDate, &readSize, readUnique) + != 4) + { // error in input fclose(fp); uidvalidity = time(nullptr); |