Debian Codegraph @

test/printfbad3.awk

raw
1 # Date: Wed, 14 Mar 2012 08:10:48 -0500
2 # From: John Haque <[email protected]>
3 # To: [email protected]
4 # Subject: gawk printf format bug
5 #
6 # Hi.
7 #
8 # I think this is a bug:
9 #
10 # $ gawk 'BEGIN { printf("%.0x%#x%#x\n", 0, 167, 167)}'
11 # 570xa7
12 #
13 # It should print 0xa70xa7.
14 #
15 # The solution is to initialize base to 0 in the beginning
16 # of the while loop along with other stuff (format_tree).
17 #
18 # Thanks.
19 #
20 # John
21
22 BEGIN { printf(">>%.0x<< >>%#x<< >>%#x<<\n", 0, 167, 167) }