On Aug 31, 1999, Nick Burrett <nick@dsvr.net> wrote:
Alexandre Oliva <oliva@dcc.unicamp.br> writes:
+++ gcc/p/rts/file.c Sun Aug 29 15:56:11 1999 @@ -887,7 +887,7 @@ _p_f_write (File, Buf, Size) [snip] - ssize_t result = + size_t result = [snip] - if (result < 0) + if (result == (size_t)-1)
You cannot do this. size_t may be unsigned.
That's the reason why I'm explicitly casting -1 to that type.
Also fwrite returned zero on error
That's not covered in the original code. Since I've never heard of fwrite returning less than -1, I think it is as correct as the original code. -- Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org} oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org} ** I may forward mail about projects to mailing lists; please use them