[Coco] glork!!!

Willard Goosey goosey at virgo.sdc.org
Mon Dec 17 06:39:34 EST 2007


Anybody ever notice that the Kreider C lib "printf" returns really
strange values?  

Yes, I know I can't expect ANSI compliance (which is to return the
number of charaters printed) but "return 0 on sucess, -1 on failure"
IS proper K&R behavior.

I was throwing together a quick yes(1) to help with using deldir in a
shell script, and was about to post it here, when I thought, "I'd
better try it under OS-9 just to make sure it works...."  

The sad thing is, I'd written a yes(1) long ago, I think it's on rtsi,
and it works.... because the printf() just *happens* to return a
positive number the way it was called.

Specifically, ..printf("foo bar\n") returned -79xxx and
... printf("%s\n","foo bar") returns 31744!

Very very strange.

Willard
-- 
Willard Goosey  goosey at sdc.org
Socorro, New Mexico, USA
"I've never been to Contempt!  Isn't that somewhere in New Mexico?"
   --- Yacko



More information about the Coco mailing list