From 7a3e0a63211ede539e70a3cfec7d63f9fa869a74 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 10 Dec 2010 14:22:18 +0100 Subject: [PATCH] Added a strncaseeq variant to the string comparison macros --- src/libstrongswan/utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libstrongswan/utils.h b/src/libstrongswan/utils.h index c41e1d6b3d..8ab7322057 100644 --- a/src/libstrongswan/utils.h +++ b/src/libstrongswan/utils.h @@ -57,7 +57,7 @@ #define streq(x,y) (strcmp(x, y) == 0) /** - * Macro compares two strings for equality + * Macro compares two strings for equality, length limited */ #define strneq(x,y,len) (strncmp(x, y, len) == 0) @@ -66,6 +66,11 @@ */ #define strcaseeq(x,y) (strcasecmp(x, y) == 0) +/** + * Macro compares two strings for equality ignoring case, length limited + */ +#define strncaseeq(x,y,len) (strncasecmp(x, y, len) == 0) + /** * Macro compares two binary blobs for equality */ -- 2.47.2