Skip to content
Tcl Source Code View Ticket
Login

View Ticket

[format] incorrectly formats hexadecimal zero

Closed / Invalid1584579fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-10-25 16:43:15
On 8.4, when the value passed to [format "%#04" ] is
zero, the command returns "0000" instead of "0x00".

$ tclsh8.4
% puts [format "%#04x %#04x" 0 1]
0000 0x01
% exit

$ tclsh8.5
% puts [format "%#04x %#04x" 0 1]
0x00 0x01
% exit

Platform: NetBSD

[email protected]
dgpplain2006-10-26 00:00:12
Logged In: YES 
user_id=80530


Any chance this is really
a bug in Tcl 8.4, that's
been fixed in 8.5 ?
dgpplain2006-10-26 00:04:26
Logged In: YES 
user_id=80530


8.5 behavior matches the
documentation for the "#"
conversion specifier.  Looks
like a bug fix to me.
Log in (anonymous is fine) to add a comment.