shithub: riscv

Download patch

ref: 5030157da9e89da53739b13c36942a5355de669f
parent: c26f2e6d27f0277a0edd1e9372b15730f7c694bf
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Aug 16 12:31:24 EDT 2023

uhtml: use IOUNIT for transfer block size

--- a/sys/src/cmd/uhtml.c
+++ b/sys/src/cmd/uhtml.c
@@ -3,7 +3,7 @@
 #include <ctype.h>
 
 int nbuf;
-char buf[64*1024+1];
+char buf[IOUNIT+1];
 char *cset = nil;
 char *whitespace = " \t\r\n";
 
@@ -180,7 +180,7 @@
 		if(write(1, p, nbuf) != nbuf)
 			sysfatal("write: %r");
 		p = buf;
-		if((nbuf = read(0, p, sizeof(buf))) < 0)
+		if((nbuf = read(0, p, sizeof(buf)-1)) < 0)
 			sysfatal("read: %r");
 	}
 	close(1);