diff options
author | Andrew Goodbody <andrew.goodbody@linaro.org> | 2025-07-08 17:51:18 +0100 |
---|---|---|
committer | Jerome Forissier <jerome.forissier@linaro.org> | 2025-08-01 09:30:47 +0200 |
commit | 9104267e676bfe254f742b56329e7c3442a2b144 (patch) | |
tree | 349ccd73477064378c4f7c334f9c045e7829ea6d | |
parent | c29c5ed2966425a14aab6794e739a78ab46178a5 (diff) |
net: wget: Fix comparison of unsigned variable
content_length is an unsigned long and so testing that it is >= 0 will
always be true. Instead test that it is != -1 as that is the condition
set on error.
This issue found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
-rw-r--r-- | net/wget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wget.c b/net/wget.c index 3c0fff488eb..428ee072330 100644 --- a/net/wget.c +++ b/net/wget.c @@ -214,7 +214,7 @@ static void tcp_stream_on_rcv_nxt_update(struct tcp_stream *tcp, u32 rx_bytes) content_length = -1; } - if (content_length >= 0) { + if (content_length != -1) { debug_cond(DEBUG_WGET, "wget: Connected Len %lu\n", content_length); |