Newsgroups: comp.std.c
Path: utzoo!utgpu!watserv1!watmath!rbutterw
From: Ray Butterworth <rbutterw@watmath.waterloo.edu>
Subject: printf precision for strings
Message-ID: <1991Apr26.143651.18289@watmath.waterloo.edu>
Sender: rbutterw@watmath.waterloo.edu (Ray Butterworth)
Organization: Math Faculty Computing Facility, University of Waterloo
Date: Fri, 26 Apr 1991 14:36:51 GMT
Lines: 11

Consider the statement:
    printf("%.*s", len, data);
If len==0, this should produce no output.
But, what if data==(char*)0 too?

With some compilers it produces the string "<nil>".
(I realize this "<nil>" is just a silly way of avoiding dumping core
 or producing meaningless garbage, but that's not what I'm asking about.)

Shouldn't the precision of 0 guarantee that no output will occur,
or does using the bad pointer mean all bets are off?
