pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Fsys read/write return value.


From: jemarch
Subject: Re: [pdf-devel] Fsys read/write return value.
Date: Fri, 15 May 2009 00:07:48 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi Gerel.

   The return description for fsys file read/write is wrong when using the 
default
   disk implementation, since fread/fwrite return the number of 'elements'
   read/written, not the number of octets.
   For them to return the number of octets they should be called like:

     fread/fwrite (data, 1, num_elems, file); /* note the '1' there */

   An alternative would be to modify the API return semantics and return the 
number
   of elements read/write like fread/fwrite do, though I'm not sure if that
   semantics is desired for other fsys implementations.

Not really. To return the number of elements of size ELEM_SIZE is ok
given that we are specifying both ELEM_SIZE and ELEM_COUNT in the
call.

   I'll send a patch for the file stream tests as soon as we resolve this.

Please add also the fix for the return value of read/write.

Thanks.

-- 
Jose E. Marchesi  <address@hidden>
                  http://www.jemarch.net
GNU Project       http://www.gnu.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]