Hi Amir,
‘len’ is the length of the string containing the text representation of ‘value’ including the trailing nil character. utils_intCopy() copies the text representation to a buffer without this trailing nil-character hence the “length + 1”.
Regards,
David Navarro
De : wakaama-dev-bounces@xxxxxxxxxxx [mailto:wakaama-dev-bounces@xxxxxxxxxxx] De la part de Kaplan, Amir
Envoyé : mercredi 19 avril 2017 16:38
À : Wakaama developer discussions <wakaama-dev@xxxxxxxxxxx>
Objet : [wakaama-dev] possible small issue?
Hi devs,
May be I wrong, but please consider looking at function:
int utils_intCopy(char * buffer,
size_t length,
int32_t value)
{
…
if (len > length + 1) return -1;
I think it should be something like :
if (len >= length) return -1;
If I wrong please just ignore.
Thanks,
Amir Kaplan
---------------------------------------------------------------------
A member of the Intel Corporation group of companies
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.