[Top][All Lists]

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

Re: printf hex conversion gives wrong values

From: Richard Dawe
Subject: Re: printf hex conversion gives wrong values
Date: Wed, 26 Jun 2002 20:32:29 +0100


Thomas Weber wrote:
> 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.

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).


Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

reply via email to

[Prev in Thread] Current Thread [Next in Thread]