Tcl Source Code

View Ticket
Login
Ticket UUID: 217918
Title: binary scan problem with 16 bit integers > 0x8000
Type: Bug Created on: 2000-10-26 00:45:58
Submitter: nobody Assigned to: nobody
Subsystem: 12. ByteArray Object Severity:
Priority: 3 Low Last modified: 2001-04-14 02:37:19
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2001-04-13 19:37:19
Version: obsolete: 8.0.4
Description:
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