Skip to content
This repository was archived by the owner on Apr 27, 2023. It is now read-only.
This repository was archived by the owner on Apr 27, 2023. It is now read-only.

Signed ints packed wrong #2

@EnTerr

Description

@EnTerr

I ran into this unpleasantry:

>>> struct.pack('b', -1)
"\127"  -- should be '\255'
>>> struct.pack('b', -7)
"y"    -- should be '\249'

Fix - comment out these 3 lines:

      if val < 0 then
        val = val + 2 ^ (n * 8 - 1)
      end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions