[AD] pack_put* clarification (Modificato da Angelo Mottola) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
I was going thru the "make the 'save' method of plugins return FALSE on
failure" todo.txt item, and when I finally finished my patch, I tested
it... Grabber kept on reporting error when I was trying to resave the
demo datafile, so something was wrong.
I checked again my patch, but didn't find the problem... I was doing
something like
rc = 0;
...
rc |= pack_putc(c, f);
...
return (rc ? FALSE : TRUE);
The Allegro docs state pack_putc() returns 0 on success or EOF on
failure. But examining the _sort_out_putc() function in file.c I
discovered this is not true... pack_putc() actually returns the
character written on success, which is obviously != 0.
So what's wrong, the docs or the function?
--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com
PS: examining file.c closer, I discovered the docs seem to be wrong:
infact functions like pack_iputw() assume pack_putc() returns the byte
written on success, not 0...