Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when writing fixed number of map value/value pairs using cbor_encoder #570

Closed
danielaparker opened this issue Dec 24, 2024 · 1 comment

Comments

@danielaparker
Copy link
Owner

danielaparker commented Dec 24, 2024

encoder.begin_object(2);
encoder.uint64_value(1);
encoder.string_value("value1");
encoder.uint64_value(2);
encoder.string_value("value2");
encoder.end_object();

Hmm, I get an error cbor_errc::too_many_items on encoder.end_object(). Have I missed something?
The program executes without errors with begin_object(4) instead of begin_object(2) but in this case the resulting data is not valid CBOR.

Originally posted by @Pique7 in #568 (reply in thread)

@danielaparker
Copy link
Owner Author

Fixed on master

@danielaparker danielaparker changed the title Issue when writing fixed number of value/value pairs using cbor_encoder Issue when writing fixed number of map value/value pairs using cbor_encoder Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant