Blame test/printfbad3.awk
|
Packit |
575503 |
# Date: Wed, 14 Mar 2012 08:10:48 -0500
|
|
Packit |
575503 |
# From: John Haque <j.eh@mchsi.com>
|
|
Packit |
575503 |
# To: arnold@skeeve.com
|
|
Packit |
575503 |
# Subject: gawk printf format bug
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# Hi.
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# I think this is a bug:
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# $ gawk 'BEGIN { printf("%.0x%#x%#x\n", 0, 167, 167)}'
|
|
Packit |
575503 |
# 570xa7
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# It should print 0xa70xa7.
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# The solution is to initialize base to 0 in the beginning
|
|
Packit |
575503 |
# of the while loop along with other stuff (format_tree).
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# Thanks.
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# John
|
|
Packit |
575503 |
|
|
Packit |
575503 |
BEGIN { printf(">>%.0x<< >>%#x<< >>%#x<<\n", 0, 167, 167) }
|