Subject: CVS commit: basesrc
To: None <source-changes@netbsd.org>
From: Luke Mewburn <lukem@netbsd.org>
List: source-changes
Date: 01/25/2001 04:06:26
Module Name:	basesrc
Committed By:	lukem
Date:		Thu Jan 25 02:06:26 UTC 2001

Modified Files:
	basesrc/lib/libc/stdio: fread.3 fread.c fwrite.c

Log Message:
apparently ansi c only required fread(3) to return 0 if size or nmembs == 0.
however, susv2 adds the same to fwrite(3), so add the explicit check.
document this for both fread & fwrite. move diagassert for buf!=NULL to after
the (size * nmembs) == 0 check.

this has the helpful side effect of preventing the _DIAGASSERT()ion in
fwrite() being triggered by lots of 3rdparty code that calls fwrite() with
buf=NULL count=0


To generate a diff of this commit:
cvs rdiff -r1.7 -r1.8 basesrc/lib/libc/stdio/fread.3
cvs rdiff -r1.13 -r1.14 basesrc/lib/libc/stdio/fread.c
cvs rdiff -r1.12 -r1.13 basesrc/lib/libc/stdio/fwrite.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.