NanoCBOR icon indicating copy to clipboard operation
NanoCBOR copied to clipboard

decoder: let get_simple() return NANOCBOR_OK, not number of bytes

Open mguetschow opened this issue 1 year ago • 0 comments

to match the docs

This aligns with most of the other nanocbor_get_* functions that also return NANOCBOR_OK instead of the number of bytes read.

However, while looking at this, I noticed the API to be slightly inconsistent as it returns the number of bytes for all number-related decoding functions such as nanocbor_get_{uint*,int*,float,double}. Was there a specific reason to do so or could we change those return values as well? In the end, the user shouldn't need to care about the amount of bytes that were consumed for a specific decoder function, right?

mguetschow avatar Feb 08 '24 11:02 mguetschow