diff options
-rw-r--r-- | src/osmux.c | 3 | ||||
-rw-r--r-- | src/rtp.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/osmux.c b/src/osmux.c index b18246f..7290d99 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -902,6 +902,9 @@ int osmux_snprintf(char *buf, size_t size, struct msgb *msg) int msg_len = msg->len; int ret; + if (size) + buf[0] = '\0'; + while (msg_len > 0) { if (msg_len < sizeof(struct osmux_hdr)) { LOGP(DLMIB, LOGL_ERROR, @@ -200,6 +200,9 @@ int osmo_rtp_snprintf(char *buf, size_t size, struct msgb *msg) uint8_t *payload; int ret, i; + if (size) + buf[0] = '\0'; + rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) return -1; |