Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!uokmax!d.cs.okstate.edu!unx2.ucc.okstate.edu!minich From: minich@unx2.ucc.okstate.edu (Robert Minich) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C 4.0 bug Message-ID: <1991Jan31.233301.2077@unx2.ucc.okstate.edu> Date: 31 Jan 91 23:33:01 GMT References: <1991Jan31.172141.13662@cbnewsk.att.com> Organization: Oklahoma State University Computer Center Lines: 25 by jeffb@cs.fau.edu (Jeffrey Boser): | While writing a uudecoder, i have stumbled on | what seems to be a bug in the ANSI libraries. | | during the decoder portion, i use | putc(o, stdout); | to output a calculated integer (lower byte only). | | but when o is equal to 10 (checked it while in debugger), | it outputs 13. (checked from a hex dump of output file). | the stdout is redirected with a ccommand. | | any ideas? Sure. Open the file as binary if you want to write binary values in there! Look in the code for fopen.c, especially the replace(), to see what is happening. Change that fopen() to something like fopen(dest_fname, "wb"); and everything should work out. Also note that when you create a file without specifying binary mode, its type is TEXT while binary files are '????'. -- |_ /| | Robert Minich | |\'o.O' | Oklahoma State University| "I'm not discouraging others from using |=(___)= | minich@d.cs.okstate.edu | their power of the pen, but mine will | U | - "Ackphtth" | continue to do the crossword." M. Ho