From: Yukihiro Matsumoto Date: 2006-11-13T08:34:55+09:00 Subject: Re: sprintf bug (?) Hi, In message "Re: sprintf bug (?)" on Mon, 13 Nov 2006 07:03:44 +0900, Timothy Hunter writes: |Possibly you meant "%010s" instead of "%10s"? In any case, I checked the |output of a C program compiled with gcc on my Powerbook running OS X |10.8. In this case, the '0' flag adds padding on the left: This is platform dependent. Linux manpage says: 0 The value should be zero padded. For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, the converted value is padded on the left with zeros rather than blanks. If the 0 and - flags both appear, the 0 flag is ignored. If a precision is given with a numeric conversion (d, i, o, u, x, and X), the 0 flag is ignored. For other conversions, the behavior is ~~~~~~~~~~~~~~~ undefined. ~~~~~~~~~ zero option affects some specifiers. %s is not among them. matz.