X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/5a96ee059968da5fd2ba4fbd6321bb3ee76b3c9d..fcb69e5cdcfdfd0bdcea2127e5f4c9133a2282b9:/access.c diff --git a/access.c b/access.c index 046d5e31..050e8cc4 100644 --- a/access.c +++ b/access.c @@ -34,7 +34,7 @@ static int match_hostname(char *host, char *tok) static int match_address(char *addr, char *tok) { char *p; - unsigned long a, t, mask = ~0; + unsigned long a, t, mask = (unsigned long)~0; if (!addr || !*addr) return 0; @@ -68,6 +68,7 @@ static int match_address(char *addr, char *tok) mask = ntohl(mask); } else { int bits = atoi(p+1); + if (bits == 0) return 1; if (bits <= 0 || bits > 32) { rprintf(FERROR,"malformed mask in %s\n", tok); return 0;