shithub: fork

Download patch

ref: 550e01b368c3256a0d4558995dfbfccb13b7c362
parent: fa05814abb2facca635db9439fcc64400214b9ed
author: qwx <qwx@sciops.net>
date: Sun Sep 17 08:56:02 EDT 2023

libdraw: bring up to date

--- a/sys/src/libdraw/readimage.c
+++ b/sys/src/libdraw/readimage.c
@@ -29,8 +29,11 @@
 		return nil;
 	if(d != nil)
 		chunk = d->bufsize - 32;	/* a little room for header */
-	else
-		chunk = 8192;
+	else {
+		chunk = iounit(fd);
+		if(chunk <= 0)
+			chunk = IOUNIT;
+	}
 
 	/*
 	 * distinguish new channel descriptor from old ldepth.