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