Hello Alessandro, On 1/20/21 4:36 PM, Alessandro Bono wrote: >>From 4562f0a369db6343902a5a3c5dd6bdb3413b64f9 Mon Sep 17 00:00:00 2001 > From: Alessandro Bono <alessandro.bono369@xxxxxxxxx> > Date: Wed, 20 Jan 2021 16:11:57 +0100 > Subject: [PATCH] fread.3: Swap size and nmemb params > > It works both way, but this one feels more right. Quite! > We are reading four > elements sizeof(*buffer) bytes each. Yes. Thank you. Patch applied. Cheers, Michael > --- > man3/fread.3 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/man3/fread.3 b/man3/fread.3 > index e1284e0..e3f34b7 100644 > --- a/man3/fread.3 > +++ b/man3/fread.3 > @@ -153,8 +153,8 @@ main(void) > > unsigned char buffer[4]; > > - size_t ret = fread(buffer, ARRAY_SIZE(buffer), sizeof(*buffer), fp); > - if (ret != sizeof(*buffer)) { > + size_t ret = fread(buffer, sizeof(*buffer), ARRAY_SIZE(buffer), fp); > + if (ret != ARRAY_SIZE(buffer)) { > fprintf(stderr, "fread() failed: %zu\en", ret); > exit(EXIT_FAILURE); > } > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/