authd: Change str_isnumber() to bool

This commit is contained in:
Matt Ullman 2016-03-23 20:07:21 -04:00
parent 5ee46e5127
commit 3889fc11af
2 changed files with 4 additions and 6 deletions

View file

@ -94,7 +94,7 @@ static const struct explore explore[] = {
#define PTON_MAX 16 #define PTON_MAX 16
static int str_isnumber(const char *); static bool str_isnumber(const char *);
static int explore_null(const struct rb_addrinfo *, static int explore_null(const struct rb_addrinfo *,
const char *, struct rb_addrinfo **); const char *, struct rb_addrinfo **);
static int explore_numeric(const struct rb_addrinfo *, const char *, static int explore_numeric(const struct rb_addrinfo *, const char *,
@ -183,7 +183,7 @@ rb_freeaddrinfo(struct rb_addrinfo *ai)
} while (ai); } while (ai);
} }
static int static bool
str_isnumber(const char *p) str_isnumber(const char *p)
{ {
char *ep; char *ep;
@ -194,9 +194,9 @@ str_isnumber(const char *p)
errno = 0; errno = 0;
(void)strtoul(p, &ep, 10); (void)strtoul(p, &ep, 10);
if (errno == 0 && ep && *ep == '\0') if (errno == 0 && ep && *ep == '\0')
return YES; return true;
else else
return NO; return false;
} }
int int

View file

@ -94,8 +94,6 @@ void rb_freeaddrinfo(struct rb_addrinfo *ai);
#define SUCCESS 0 #define SUCCESS 0
#define ANY 0 #define ANY 0
#define YES 1
#define NO 0
#undef EAI_ADDRFAMILY #undef EAI_ADDRFAMILY
#undef EAI_AGAIN #undef EAI_AGAIN