[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Bug in printf



Paul Hoffman <pubs@proper.com> writes:
In message <v0300780aae5e05f83f2e@[165.227.113.247]> you write:
>There's a small bug in printf with strings and the # tag. The odd thing is
>that the action changed from MacPerl 4 to MacPerl 5.

Easy to explain: I switched compilers between Perl4 and Perl5, and 
Metrowerks C, the Compiler of Choice for MacPerl5 (tm), treats 
%#s as a special case to read/write a Pascal string (a string preceded by
a length byte instead of terminated with a 0 character). 

This behavior seems entirely legitimate to me, as the C standard has no
other definition for %#s. What was your intent in using %#20.20s?

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
  "The level of chat on those programmes is about as low as it is possible
   to get without actually serving the viewers gin." -- Gore Vidal