diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index be5a0d606..05ae95f3f 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -72,7 +72,7 @@ static inline int mgcp_msg_terminate_nul(struct msgb *msg) if (tail[-1] == '\0') /* nothing to do */; else if (msgb_tailroom(msg) > 0) - tail[0] = '\0'; + msgb_put_u8(msg, (uint8_t)'\0'); else if (tail[-1] == '\r' || tail[-1] == '\n') tail[-1] = '\0'; else {