return (NULL);
}
- if (strncmp(line, "#CUPS-PPD-CACHE-", 16) ||
- atoi(line + 16) != _PPD_CACHE_VERSION)
+ if (strncmp(line, "#CUPS-PPD-CACHE-", 16))
{
_cupsSetError(IPP_INTERNAL_ERROR, _("Bad PPD cache file."), 1);
DEBUG_printf(("_ppdCacheCreateWithFile: Wrong first line \"%s\".", line));
return (NULL);
}
+ if (atoi(line + 16) != _PPD_CACHE_VERSION)
+ {
+ _cupsSetError(IPP_INTERNAL_ERROR, _("Out of date PPD cache file."), 1);
+ DEBUG_printf(("_ppdCacheCreateWithFile: Cache file has version %s, "
+ "expected %d.", line + 16, _PPD_CACHE_VERSION));
+ cupsFileClose(fp);
+ return (NULL);
+ }
+
/*
* Allocate the mapping data structure...
*/