MT#61856 sdp.c: use a proper type for port append

In `sdp_out_add_media()` the port is given as
`unsigned int` but then is being appended to the SDP body
as `%i`. Instead the `%u` should actually be used.

Same for the `sdp_out_add_osrtp_media()` which treats
the `unsigned int` as the `signed` one actually.

Change-Id: I6a7a45e9a0daa70ffffd17d2a35ff7db8c8cf7ab
pull/1126/merge
Donat Zenichev 1 week ago
parent 2d4fcf2a71
commit 50daf6f0ec

@ -3279,7 +3279,7 @@ __attribute__((nonnull(1, 2, 3)))
static void sdp_out_add_osrtp_media(GString *out, struct call_media *media,
const struct transport_protocol *prtp, const endpoint_t *address)
{
g_string_append_printf(out, "m=" STR_FORMAT " %d %s ",
g_string_append_printf(out, "m=" STR_FORMAT " %u %s ",
STR_FMT(&media->type),
address ? address->port : 0,
prtp->name);
@ -3297,12 +3297,12 @@ static bool sdp_out_add_media(GString *out, struct call_media *media,
unsigned int port)
{
if (media->protocol)
g_string_append_printf(out, "m=" STR_FORMAT " %i %s ",
g_string_append_printf(out, "m=" STR_FORMAT " %u %s ",
STR_FMT(&media->type),
port,
media->protocol->name);
else if (media->protocol_str.s)
g_string_append_printf(out, "m=" STR_FORMAT " %i " STR_FORMAT " ",
g_string_append_printf(out, "m=" STR_FORMAT " %u " STR_FORMAT " ",
STR_FMT(&media->type),
port,
STR_FMT(&media->protocol_str));

Loading…
Cancel
Save