CBOR allows empty text and byte strings and QBOR supports them with AddText() and AddBytes() with a size of zero.
This however resulted in a call to memmove with a NULL pointer if the zero length string also (logically) had a null pointer (e.g., was NULLUsefulBufC). Calling memmove with a NULL pointer is not recommended and some static analyzers will correctly complain.
This PR also documents the support in UsefulBuf and adds tests.
CBOR allows empty text and byte strings and QBOR supports them with AddText() and AddBytes() with a size of zero.
This however resulted in a call to memmove with a NULL pointer if the zero length string also (logically) had a null pointer (e.g., was NULLUsefulBufC). Calling memmove with a NULL pointer is not recommended and some static analyzers will correctly complain.
This PR also documents the support in UsefulBuf and adds tests.
This addresses #164