From ea7b73aac55177d1d556d0c9dba04b0870d3aaf6 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 16 Sep 2025 20:49:49 -0400 Subject: Allow short reads from read_func --- pom.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pom.h') diff --git a/pom.h b/pom.h index 8ae9ff1..e7f8777 100644 --- a/pom.h +++ b/pom.h @@ -138,9 +138,9 @@ typedef struct pom_settings { /// /// `read_func` will be passed the `userdata` pointer passed to this function, /// a buffer, and the length of that buffer (which will be nonzero). -/// It must fill out the buffer as much as possible, -/// and return the number of bytes read. -/// A return value less than `len` indicates the end of the file was reached. +/// It returns the number of bytes read, or 0 if the end of the file was reached. +/// It can fill out as much or as little of the buffer as it wants — +/// a short read count is not interpreted as the end of the file. /// `read_func` will not be called excessively/with lots of tiny reads—it's /// okay to do unbuffered reads in it. /// -- cgit v1.2.3