summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2014-06-15 00:33:20 +0800
committerTing-Wei Lan <lantw44@gmail.com>2014-06-15 00:33:20 +0800
commit053413943c45d190bb69c997f94e3bee8fa7f95e (patch)
tree65a224fbf92803c5c30434887818d904b70eccc3
parentba5ba8c2e0cc8772c530c32353bf2a16144defac (diff)
downloadfastalg-protocol-053413943c45d190bb69c997f94e3bee8fa7f95e.tar.gz
fastalg-protocol-053413943c45d190bb69c997f94e3bee8fa7f95e.tar.zst
fastalg-protocol-053413943c45d190bb69c997f94e3bee8fa7f95e.zip
hostname: Hostname should be case-insensitive
-rw-r--r--falgproto/falgproto-match-hostname.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/falgproto/falgproto-match-hostname.c b/falgproto/falgproto-match-hostname.c
index b093c6a..9957df8 100644
--- a/falgproto/falgproto-match-hostname.c
+++ b/falgproto/falgproto-match-hostname.c
@@ -3,6 +3,7 @@
#include "config.h"
#include "falgproto.h"
+#include <ctype.h>
#include <stdbool.h>
@@ -11,7 +12,8 @@ FALGPROTO_MATCHER_DECL (hostname) {
const char *big_end = big + big_len;
const char *little_end = little + little_len;
- for (; big_end >= big && little_end >= little && *big_end == *little_end;
+ for (; big_end >= big && little_end >= little &&
+ toupper (*big_end) == toupper (*little_end);
big_end--, little_end--);
if (little_end < little) {