fixed bug in size-calculation of coap_new_error_response() (applied patch from Thomas Stammeier)

The calculation of required space for textual error phrase did not take into account the one
byte for the payload start marker.
This commit is contained in:
Olaf Bergmann committed 2013-02-04 11:01:13 +01:00
1 parent b465bcc692
commit c007638c1a
1 file changed
+2 -2
+2 -2
View File
@@ -775,9 +775,9 @@ coap_new_error_response(coap_pdu_t *request, unsigned char code,
#if COAP_ERROR_PHRASE_LENGTH > 0
char *phrase = coap_response_phrase(code);
/* Need some more space for the error phrase */
/* Need some more space for the error phrase and payload start marker */
if (phrase)
size += strlen(phrase);
size += strlen(phrase) + 1;
#endif
assert(request);