History

avformat/udp: avoid warning about always false comparison

socklen_t underlying type can be signed or unsigned depending on platform. This is fine, just cast it to size_t before comparison. Fixes: warning: result of comparison of unsigned expression < 0 is always false [-Wtautological-unsigned-zero-compare]

Kacper Michajłow committed 1 year ago

Commit 29d274a1 parent ce048771 file · +1 −1Browse files

Unified · Split

libavformat/udp.c+1−1
@@ -473,7 +473,7 @@ int ff_udp_set_remote_addr(URLContext *h, const struct sockaddr *dest_addr, sock · 472 unmodified lines
473 UDPContext *s = h->priv_data;473 UDPContext *s = h->priv_data;
474 474
475 /* set the destination address */475 /* set the destination address */
476 if (dest_addr_len < 0 || dest_addr_len > sizeof(s->dest_addr))476 if ((size_t)dest_addr_len > sizeof(s->dest_addr))
477 return AVERROR(EIO);477 return AVERROR(EIO);
478 s->dest_addr_len = dest_addr_len;478 s->dest_addr_len = dest_addr_len;
479 memcpy(&s->dest_addr, dest_addr, dest_addr_len);479 memcpy(&s->dest_addr, dest_addr, dest_addr_len);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t