[comp.binaries.apple2] unblu.c

matthew@sunpix.UUCP ( Sun NCAA) (04/08/89)

Warning!  I recently got around to compiling and using Marcel Mol's unblu
program.  It compiled without error, but while extracting the first file
of a multi-file .BNY file, it complained about an invalid .BNY file.  
While trying to debug the code I found it was stopping 256 bytes short of 
the end of the first file. Checking through the code I found the problem.

The code assumed that it was being compiled by a compiler that defaulted 
to unsigned 'char's.  The 'C' compiler under SunOS 4.0 defaults to signed
chars.  After redeclaring all declarations of 'buf' from 'char *buf;' to
'unsigned char *buf;' the program compiled and executed correctly.

Moral: when using a char to hold anything but characters, ensure you declare
it signed or unsigned as necessary.



-- 
Matthew Lee Stier                         |
Sun Microsystems ---  RTP, NC  27709-3447 |        "Wisconsin   Escapee"
uucp: { sun, mcnc!rti }!sunpix!matthew    |
phone: (919) 469-8300 fax: (919) 460-8355 |