Compare commits

...

3 Commits

Author SHA1 Message Date
DTB
9addfc9284
Merge branch 'dj' 2024-07-15 02:36:07 -06:00
DTB
8f8de5de2b
dj(1): fix io[0].bufuse underflow 2024-07-08 22:53:44 -06:00
DTB
0df2c9f566
dj(1): fix infiniskipping 2024-07-08 22:48:16 -06:00

View File

@ -263,12 +263,12 @@ int main(int argc, char *argv[]){
assert(io[0].bufuse == 0); assert(io[0].bufuse == 0);
{ /* read */ { /* read */
char skipping; long skipping;
size_t t; size_t t;
/* hack to intentionally get a partial read from Io_read */ /* 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; io[0].bufuse = io[0].bs - (size_t)skipping;
t = io[0].bufuse; t = io[0].bufuse;
if(Io_read(&io[0])->bufuse == t && !noerror && io[0].error == 0) if(Io_read(&io[0])->bufuse == t && !noerror && io[0].error == 0)
@ -290,7 +290,8 @@ int main(int argc, char *argv[]){
} }
} }
if(skipping){ if(skipping > 0){
io[0].seek -= skipping;
io[0].bufuse = 0; io[0].bufuse = 0;
count += (count != 0); count += (count != 0);
continue; continue;