You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I appreciate the quick changes made in #223 to provide visibility into the internal cursor.
The current API, which is accurately documented in the header below, makes it impossible to distinguish between the error state and a valid cursor positioned at the end-of-input.
* would be next decoded with QCBORDecode_VGetNext(). If the cursor
* is at the end of the input or in the error state, @c UINT32_MAX is
* returned.
In my use of this function, I need to undo the following conversion logic and requires an additional call into UsefulInputBuf_GetBufferLength(). It seems to me that this logic is not really necessary and is not as efficient as simply not including this block (and updating the documentation appropriately). The reason is that a cursor at the end-of-input is perfectly valid situation to be in, and if a user application cares about this condition it can detect it as it needs to.
QCBORDecode_Tell() returns the offset when at the end of the input rather than UINT32_MAX. This is a non-compatible change, but QCBORDecode_Tell() was very recently introduced and is not present in any official releases.
QCBORDecode_EndCheck() is added to check to see if the cursor is at the end of the input.
Addresses #230
* Add EndCheck(); change Tell() behavior
* Minor corrections
* Minor doc update
---------
Co-authored-by: Laurence Lundblade <lgl@securitytheory.com>
I appreciate the quick changes made in #223 to provide visibility into the internal cursor.
The current API, which is accurately documented in the header below, makes it impossible to distinguish between the error state and a valid cursor positioned at the end-of-input.
QCBOR/inc/qcbor/qcbor_decode.h
Lines 1054 to 1056 in b239c65
In my use of this function, I need to undo the following conversion logic and requires an additional call into
UsefulInputBuf_GetBufferLength()
. It seems to me that this logic is not really necessary and is not as efficient as simply not including this block (and updating the documentation appropriately). The reason is that a cursor at the end-of-input is perfectly valid situation to be in, and if a user application cares about this condition it can detect it as it needs to.QCBOR/src/qcbor_decode.c
Lines 3167 to 3172 in b239c65
The text was updated successfully, but these errors were encountered: