mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 21:13:44 +00:00
cosmetic: protocol: remove unnecessary nul termination
Adding a NUL manually is a common idiom after calling strncpy() because strncpy() does not always NUL-terminate the string. But snprintf() is fine. - remove NUL termination after snprintf in mgcp_send_reset_ep() Change-Id: I5a1187b13b21b11674f13d3449c730616b0a4ddf
This commit is contained in:
@@ -1242,8 +1242,6 @@ int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint)
|
|||||||
if (len < 0)
|
if (len < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
buf[sizeof(buf) - 1] = '\0';
|
|
||||||
|
|
||||||
rc = send_agent(endp->cfg, buf, len);
|
rc = send_agent(endp->cfg, buf, len);
|
||||||
if (rc <= 0)
|
if (rc <= 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user