From c661edaff03a270b27dbd4dfbab9dd677880b778 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 13 Jun 2015 12:06:33 -0400 Subject: [PATCH] dnpds40: Don't perform job sanity checks if there is no job! --- backend_dnpds40.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend_dnpds40.c b/backend_dnpds40.c index 46be248..c7147f7 100644 --- a/backend_dnpds40.c +++ b/backend_dnpds40.c @@ -448,6 +448,9 @@ static int dnpds40_read_parse(void *vctx, int data_fd) { ctx->datalen += sizeof(struct dnpds40_cmd) + j; } + if (!ctx->datalen) + return CUPS_BACKEND_CANCEL; + /* Figure out the number of buffers we need. Most only need one. */ if (multicut) { ctx->buf_needed = 1; @@ -483,9 +486,6 @@ static int dnpds40_read_parse(void *vctx, int data_fd) { DEBUG("dpi %u matte %u mcut %u bufs %d\n", dpi, matte, multicut, ctx->buf_needed); - if (!ctx->datalen) - return CUPS_BACKEND_CANCEL; - return CUPS_BACKEND_OK; }