bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Warning in http.c


From: Gisle Vanem
Subject: Warning in http.c
Date: Sat, 22 Feb 2020 00:04:19 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Hi list.

Just built Wget (master) using clang-cl and noticed this important
warning:
  http.c(874,11): warning:
  ordered comparison between pointer and integer ('size_t' (aka 'unsigned int') 
and 'char *')
   if (len < buf)
        ~~~ ^ ~~~

For the line:
  if (len < buf)
    copy = buf;

(which should always be true).

Surely it should read:
  if (len < sizeof(buf))
    copy = buf;


--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]