s3:lib:wins fix a compile warning on Ubuntu 18.04
authorChristian Ambach <ambi@samba.org>
Tue, 22 Oct 2019 09:02:05 +0000 (11:02 +0200)
committerUri Simchoni <uri@samba.org>
Wed, 23 Oct 2019 04:57:08 +0000 (04:57 +0000)
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1) with -O2 puts up a warning here:
../../source3/lib/wins_srv.c: In function ‘wins_srv_tags’:
../../source3/lib/wins_srv.c:235:3: error: assuming signed overflow does not
occur when simplifying conditional to constant [-Werror=strict-overflow]
   for (j=0;j<count;j++) {
   ^~~
cc1: all warnings being treated as errors

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Oct 23 04:57:09 UTC 2019 on sn-devel-184

source3/lib/wins_srv.c

index 4872d1c75b38050c5ce0bbf8df029adf695616e7..23796a2c5f427166018f9eaf862fae62e05419ba 100644 (file)
@@ -208,7 +208,7 @@ static void parse_ip(struct tagged_ip *ip, const char *str)
 char **wins_srv_tags(void)
 {
        char **ret = NULL;
-       int count=0, i, j;
+       unsigned int count=0, i, j;
        const char **list;
 
        if (lp_we_are_a_wins_server()) {