Simplification of final return statement

This commit is contained in:
0x1eef 2023-09-20 12:31:18 -03:00
parent 760852b6dc
commit 637256206f

View file

@ -9,7 +9,6 @@ static const int MAX_OCTETS = 4;
static const int MAX_DIGITLEN = 12;
static const int MAX_STRLEN = 16;
static const char SEP = '.';
static int in_range(char buf[MAX_BUFLEN]);
int
@ -45,11 +44,7 @@ isinetaddr4(const char *str)
octets++;
}
}
if (octets == MAX_OCTETS) {
return digits <= MAX_DIGITLEN;
} else {
return 0;
}
return octets == MAX_OCTETS && digits <= MAX_DIGITLEN;
}
static int