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]
Unified · Split
| @@ -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); |