From 3af7523f0e806fb34dcc01ec4b9e37a988b58674 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 6 Sep 2016 17:32:01 -0400 Subject: [PATCH] DNP: You'd think a simple "prints remaining" counter would be simple.. *grumblegrumblestupidpfirmwarequirks* --- backend_dnpds40.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend_dnpds40.c b/backend_dnpds40.c index 037a417..c1346b2 100644 --- a/backend_dnpds40.c +++ b/backend_dnpds40.c @@ -1279,6 +1279,10 @@ top: count = atoi((char*)resp+4); free(resp); + /* Old-sk00l models report one less than they should */ + if (!ctx->correct_count) + count++; + count -= ctx->mediaoffset; if (ctx->media_count_new) { @@ -1417,6 +1421,10 @@ top: count = atoi((char*)resp+4); free(resp); + /* Old-sk00l models report one less than they should */ + if (!ctx->correct_count) + count++; + count -= ctx->mediaoffset; if (ctx->media_count_new) { @@ -1833,6 +1841,10 @@ static int dnpds40_get_status(struct dnpds40_ctx *ctx) count = atoi((char*)resp+4); free(resp); + /* Old-sk00l models report one less than they should */ + if (!ctx->correct_count) + count++; + count -= ctx->mediaoffset; INFO("Native Prints Remaining on Media: %d\n", count);