diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2014-06-15 00:33:20 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw44@gmail.com> | 2014-06-15 00:33:20 +0800 |
commit | 053413943c45d190bb69c997f94e3bee8fa7f95e (patch) | |
tree | 65a224fbf92803c5c30434887818d904b70eccc3 | |
parent | ba5ba8c2e0cc8772c530c32353bf2a16144defac (diff) | |
download | fastalg-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.c | 4 |
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) { |