net.c: correct return value in coap_send_internal()

The interface description of coap_send_internal says that COAP_INVALID_MID
is returned  in the case of errors. Presently, it, however, returns
"(coap_mid_t)bytes_written" in a special case. Accidentally,
bytes_written == -1 == COAP_INVALID_MID in this specific case, which is why
no problems occur in practice due to this. As a cosmetic fix, this commit
changes the return value to COAP_INVALID_MID.
This commit is contained in:
kkrentz committed 2021-12-14 15:37:34 +01:00
1 parent cca9c858b9
commit 693a4e2313
1 file changed
+1 -2
+1 -2
View File
@@ -1281,8 +1281,7 @@ coap_send_internal(coap_session_t *session, coap_pdu_t *pdu) {
}
if (bytes_written < 0) {
coap_delete_pdu(pdu);
return (coap_mid_t)bytes_written;
goto error;
}
#if !COAP_DISABLE_TCP