From 01486bf4a4864efdd964b167cd72b15fb0456485 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 30 Dec 2024 11:31:52 +0100 Subject: [PATCH] change find header with for loop --- src/kds_s2000w_net.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index fd46d79..b8a89ac 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -23,14 +23,15 @@ int _sane_kds_s2000w_net_find_first_data_byte(imagedata* image) int space_count = 0; int byte_count = 0; - - while(space_count < header_spaces && byte_count < image->size) { + for (byte_count = 0; byte_count < image->size; byte_count++) { if (data[byte_count] == SPACE) space_count++; - byte_count++; + if (space_count >= header_spaces) + break; } + byte_count++; return byte_count; } -- 2.39.5