diff --git a/CHANGES.md b/CHANGES.md index 710fbbfd..d88590b4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,3 +11,4 @@ Changes in v2.0b1 with libcups v3 (Issue #221) - Fixed potential crash while listing devices (Issue #296) - Fixed potential deadlock issue (Issue #297) +- Fixed loading of previous state (Issue #298) diff --git a/pappl/system-loadsave.c b/pappl/system-loadsave.c index 1f7cb200..78678e5a 100644 --- a/pappl/system-loadsave.c +++ b/pappl/system-loadsave.c @@ -137,7 +137,7 @@ papplSystemLoadState( pappl_printer_t *printer; // Current printer - if ((num_options = cupsParseOptions(value, 0, &options)) != 5 || (printer_id = cupsGetOption("id", num_options, options)) == NULL || strtol(printer_id, NULL, 10) <= 0 || (printer_name = cupsGetOption("name", num_options, options)) == NULL || (device_id = cupsGetOption("did", num_options, options)) == NULL || (device_uri = cupsGetOption("uri", num_options, options)) == NULL || (driver_name = cupsGetOption("driver", num_options, options)) == NULL) + if ((num_options = cupsParseOptions(value, 0, &options)) == 0 || (printer_id = cupsGetOption("id", num_options, options)) == NULL || strtol(printer_id, NULL, 10) <= 0 || (printer_name = cupsGetOption("name", num_options, options)) == NULL || (device_id = cupsGetOption("did", num_options, options)) == NULL || (device_uri = cupsGetOption("uri", num_options, options)) == NULL || (driver_name = cupsGetOption("driver", num_options, options)) == NULL) { papplLog(system, PAPPL_LOGLEVEL_ERROR, "Bad printer definition on line %d of '%s'.", linenum, filename); break;