Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Passing NULLs to printf Message-ID: <6195@brl-smoke.ARPA> Date: Wed, 29-Jul-87 20:36:55 EDT Article-I.D.: brl-smok.6195 Posted: Wed Jul 29 20:36:55 1987 Date-Received: Sat, 1-Aug-87 00:52:12 EDT References: <1407@cullvax.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <1407@cullvax.UUCP> drw@cullvax.UUCP (Dale Worley) writes: > printf("%.0s", (char *)NULL) >This should print zero characters out of the string, and so won't >actually reference any character through the null pointer. Presumably >this is valid ANSI C! No, why should it be? The printf() implementation may very well always inspect the argument string to find its null terminator, for example to determine its length before converting it.