From 3889fc11af15b5dd60394640962ac5b5bd3b1459 Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Wed, 23 Mar 2016 20:07:21 -0400 Subject: [PATCH] authd: Change str_isnumber() to bool --- authd/getaddrinfo.c | 8 ++++---- authd/getaddrinfo.h | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/authd/getaddrinfo.c b/authd/getaddrinfo.c index f7642875..e1c7ba6c 100644 --- a/authd/getaddrinfo.c +++ b/authd/getaddrinfo.c @@ -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 diff --git a/authd/getaddrinfo.h b/authd/getaddrinfo.h index 746db142..290abd53 100644 --- a/authd/getaddrinfo.h +++ b/authd/getaddrinfo.h @@ -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