Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site axiom.UUCP
Path: utzoo!linus!axiom!smk
From: smk@axiom.UUCP (Steven M. Kramer)
Newsgroups: net.unix-wizards
Subject: How good is YOUR UNIX?
Message-ID: <485@axiom.UUCP>
Date: Thu, 9-Feb-84 18:51:31 EST
Article-I.D.: axiom.485
Posted: Thu Feb  9 18:51:31 1984
Date-Received: Fri, 10-Feb-84 08:17:10 EST
Organization: Axiom Technology, Newton MA
Lines: 18


What will:
	fprintf (file, "string with zero %c in it\n", '\0');

do on YOUR machine (assuming file is properly decared to be FILE * and
a file is opened OK...).
For you slow ones, the point is will the zero byte actually get
printed out?  If not, your doprnt has a bug.  Some doprnt()s know
the character argument is turned into an integer (basic C stuff).
Doprnt reads bytes, checks to see if 0, if so, backs up in the resultant
string and then goes to the next byte for sizeof(int)/sizeof(char)
on your machine.  The bug is that you can't print a '\0'!  ...and yes,
I want to for instance when I want to write strings to a file WITH the
null byte.
-- 
	--steve kramer
	{allegra,genrad,ihnp4,utzoo,philabs,uw-beaver}!linus!axiom!smk	(UUCP)
	linus!axiom!smk@mitre-bedford					(MIL)