mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 00:14:07 +01:00
authd: Change str_isnumber() to bool
This commit is contained in:
parent
5ee46e5127
commit
3889fc11af
2 changed files with 4 additions and 6 deletions
|
@ -94,7 +94,7 @@ static const struct explore explore[] = {
|
|||
|
||||
#define PTON_MAX 16
|
||||
|
||||
static int str_isnumber(const char *);
|
||||
static bool str_isnumber(const char *);
|
||||
static int explore_null(const struct rb_addrinfo *,
|
||||
const char *, struct rb_addrinfo **);
|
||||
static int explore_numeric(const struct rb_addrinfo *, const char *,
|
||||
|
@ -183,7 +183,7 @@ rb_freeaddrinfo(struct rb_addrinfo *ai)
|
|||
} while (ai);
|
||||
}
|
||||
|
||||
static int
|
||||
static bool
|
||||
str_isnumber(const char *p)
|
||||
{
|
||||
char *ep;
|
||||
|
@ -194,9 +194,9 @@ str_isnumber(const char *p)
|
|||
errno = 0;
|
||||
(void)strtoul(p, &ep, 10);
|
||||
if (errno == 0 && ep && *ep == '\0')
|
||||
return YES;
|
||||
return true;
|
||||
else
|
||||
return NO;
|
||||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -94,8 +94,6 @@ void rb_freeaddrinfo(struct rb_addrinfo *ai);
|
|||
|
||||
#define SUCCESS 0
|
||||
#define ANY 0
|
||||
#define YES 1
|
||||
#define NO 0
|
||||
|
||||
#undef EAI_ADDRFAMILY
|
||||
#undef EAI_AGAIN
|
||||
|
|
Loading…
Reference in a new issue