On 2014/08/01 18:28, Guenther Niess wrote:
> Hello,
> 
> In the latest snapshot on amd64:
> 
> OpenBSD 5.6 (GENERIC.MP) #314: Thu Jul 31 15:16:43 MDT 2014
>     [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
> I ran into a strange bug. In one backup script I calculate with the
> result of `date "+%m"` and now I'm getting bad number exceptions.
> I realized that leading zeros for numbers >7 are making problems.

The zero prefix means that the numbers are treated as octal.


> $printf "%d\n" 01
> 1
> $printf "%d\n" 02
> 2
> $printf "%d\n" 03
> 3
> $printf "%d\n" 04
> 4
> $printf "%d\n" 05
> 5
> $printf "%d\n" 06
> 6
> $printf "%d\n" 07
> 7
> $printf "%d\n" 08
> printf: 08: not completely converted
> 0
> $printf "%d\n" 09
> printf: 09: not completely converted
> 0
> 
> Best regards
> Guenther Niess

Reply via email to