From: Martin Willi Date: Fri, 10 Dec 2010 13:22:18 +0000 (+0100) Subject: Added a strncaseeq variant to the string comparison macros X-Git-Tag: 4.5.1~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a3e0a63211ede539e70a3cfec7d63f9fa869a74;p=thirdparty%2Fstrongswan.git Added a strncaseeq variant to the string comparison macros --- 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 */