summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-13 18:02:20 +0000
committerYang Tse <yangsita@gmail.com>2007-02-13 18:02:20 +0000
commit2bd57a6d3079af9235f84b2bacced2794f8acdd3 (patch)
treed07c9b06aed7e5e948fa0132b9c00f01e01900c3
parent05da7b7fdaa64ceb3b5c39454978b5f8570aa78c (diff)
downloadc-ares-2bd57a6d3079af9235f84b2bacced2794f8acdd3.tar.gz
c-ares-2bd57a6d3079af9235f84b2bacced2794f8acdd3.tar.bz2
c-ares-2bd57a6d3079af9235f84b2bacced2794f8acdd3.zip
use our own ISUPPER and ISLOWER macros
-rw-r--r--inet_net_pton.c2
-rw-r--r--setup_once.h2
-rw-r--r--windows_port.c4
3 files changed, 5 insertions, 3 deletions
diff --git a/inet_net_pton.c b/inet_net_pton.c
index 8c78a0b..49bac69 100644
--- a/inet_net_pton.c
+++ b/inet_net_pton.c
@@ -86,7 +86,7 @@ inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size)
dirty = 0;
src++; /* skip x or X. */
while ((ch = *src++) != '\0' && ISXDIGIT(ch)) {
- if (isupper(ch))
+ if (ISUPPER(ch))
ch = tolower(ch);
n = (int)(strchr(xdigits, ch) - xdigits);
if (dirty == 0)
diff --git a/setup_once.h b/setup_once.h
index 6cfa526..187f5e1 100644
--- a/setup_once.h
+++ b/setup_once.h
@@ -122,6 +122,8 @@
#define ISGRAPH(x) (isgraph((int) ((unsigned char)x)))
#define ISALPHA(x) (isalpha((int) ((unsigned char)x)))
#define ISPRINT(x) (isprint((int) ((unsigned char)x)))
+#define ISUPPER(x) (isupper((int) ((unsigned char)x)))
+#define ISLOWER(x) (islower((int) ((unsigned char)x)))
/*
diff --git a/windows_port.c b/windows_port.c
index 2d84274..dabe0bc 100644
--- a/windows_port.c
+++ b/windows_port.c
@@ -41,8 +41,8 @@ ares_strncasecmp(const char *a, const char *b, int n)
int i;
for (i = 0; i < n; i++) {
- int c1 = isupper(a[i]) ? tolower(a[i]) : a[i];
- int c2 = isupper(b[i]) ? tolower(b[i]) : b[i];
+ int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
+ int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
if (c1 != c2) return c1-c2;
}
return 0;