Re: printf hex conversion gives wrong values
Richard Dawe <[email protected]> Wed, 26 Jun 2002 20:32:29 +0100
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hello. Thomas Weber wrote: [snip] > during developing a new shell script; I detected an erroneous behaviour > of the printf command. > printf fails on hex conversion for 008 and 009 and gives wrong values > for higher numbers, if the digit to convert contains leading zeroes. > Without leading zeroes the conversion succeeds. [snip] I'm guessing that 'printf' is interpretting the number as an octal number, because of the leading zeroes. I can't seem to find anything in 'man printf' or 'info printf' to confirm this, though (DJGPP port of sh-utils 2.0.11). Gruesse, -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]