Skip to content

CBOR.decode("A\x00") returns empty string instead of "\x00" #11

@grzuy

Description

@grzuy

Hi,

Is the following expected?

$ irb
irb(main):001:0> require "libcbor/all"
.gem/ruby/2.6.5/gems/libcbor-0.1.0/lib/libcbor.rb:50: warning: constant ::Fixnum is deprecated
=> true
irb(main):002:0> CBOR.decode("C\x01\x02\x03")
=> "\x01\x02\x03"
irb(main):003:0> CBOR.decode("C\x01\x00\x03")
=> "\x01"
irb(main):004:0> CBOR.decode("A\x00")
=> ""

I mean the last two decode return values.

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