From 0df2c9f56696fb16695c77665654d287eb90298e Mon Sep 17 00:00:00 2001 From: DTB Date: Mon, 8 Jul 2024 22:48:16 -0600 Subject: [PATCH] dj(1): fix infiniskipping --- src/dj.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dj.c b/src/dj.c index 8fe1af3..e36623e 100644 --- a/src/dj.c +++ b/src/dj.c @@ -263,11 +263,11 @@ int main(int argc, char *argv[]){ assert(io[0].bufuse == 0); { /* read */ - char skipping; + long skipping; size_t t; /* hack to intentionally get a partial read from Io_read */ - if((skipping = (io[0].seek > 0)) && io[0].seek < io[0].bs) + if((skipping = MIN(io[0].seek, io[0].bs)) > 0) io[0].bufuse = io[0].bs - io[0].seek; t = io[0].bufuse; @@ -290,7 +290,8 @@ int main(int argc, char *argv[]){ } } - if(skipping){ + if(skipping > 0){ + io[0].seek -= skipping; io[0].bufuse = 0; count += (count != 0); continue;