This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Fix ar -M


On Fri, Oct 19, 2001 at 06:21:37PM -0400, DJ Delorie wrote:
> 
> > +  sprintf(tname, "%.*stmp-%s", (int) (bname - name), name, bname);
> 
> I wonder if we can count on sprintf printing "" with bname-name is
> zero?  I know if you use %.*c with zero, it prints one character.

But %.*c is different from %.*s, isn't it.
Particularly, precision behaviour is defined for diouxX conversions (min
number of digits), eEf (number of digits after radix), gG (maximum number of
significant digits), sS (maximum number of bytes to be printed).
Ie. no mention for precision with c conversion (what would that mean?), but
apparently any implementation which for %.*s 0, string would output more than 0
zero characters would break the standard (it would output more than the
maximum number of characters it is allowed to output).

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]