Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-14
02:37 • Ticket [217918ffff] binary scan problem with 16 bit integers > 0x8000 sta... artifact: 670877a6ad user: dgp
2000-10-26
08:09 • Closed ticket [217918ffff]. artifact: ee52ca97ac user: welch
00:45 • New ticket [217918ffff]. artifact: 1a1794fa68 user: nobody

binary scan problem with 16 bit integers > 0x8000

Closed / Fixed217918ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:45:58
OriginalBugID: 3229 Bug
Version: 8.0.4
SubmitDate: '1999-10-28'
LastModified: '1999-11-08'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 3466
OS: Linux
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-11-08'


Name:
Bob Findlay

ReproducibleScript:
#!/usr/bin/tclsh
    set bob1 0x8000
    set bob2 [binary format "s1" $bob1]
    binary scan $bob2 s1 bob3
    puts stdout [format "bob1=%X bob3=%X" $bob1 $bob3]

ObservedBehavior:
It seems once the lead bit in a 16 bit integer is set the binary
    scan command seems to prepend the result with 0xffff
    
    This does not seem like the correct behavior.

DesiredBehavior:
I would have expected that binary scan would return with the 16 bit
    value 
    without the prepended 0xffff
welch Closed ticket [217918ffff]. [History diff]2000-10-26 08:09:13
dgp Ticket [217918ffff]: 3 changes [History diff]2001-04-14 02:37:19
Log in (anonymous is fine) to add a comment.