diff options
Diffstat (limited to 'src/lib/libcrypto/o_str.c')
-rw-r--r-- | src/lib/libcrypto/o_str.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/libcrypto/o_str.c b/src/lib/libcrypto/o_str.c index da8860491d..59cc25094b 100644 --- a/src/lib/libcrypto/o_str.c +++ b/src/lib/libcrypto/o_str.c | |||
@@ -60,6 +60,10 @@ | |||
60 | #include <e_os.h> | 60 | #include <e_os.h> |
61 | #include "o_str.h" | 61 | #include "o_str.h" |
62 | 62 | ||
63 | #if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && !defined(OPENSSL_SYSNAME_WIN32) | ||
64 | # include <strings.h> | ||
65 | #endif | ||
66 | |||
63 | int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n) | 67 | int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n) |
64 | { | 68 | { |
65 | #if defined(OPENSSL_IMPLEMENTS_strncasecmp) | 69 | #if defined(OPENSSL_IMPLEMENTS_strncasecmp) |
@@ -94,3 +98,12 @@ int OPENSSL_strcasecmp(const char *str1, const char *str2) | |||
94 | #endif | 98 | #endif |
95 | } | 99 | } |
96 | 100 | ||
101 | int OPENSSL_memcmp(const void *v1,const void *v2,size_t n) | ||
102 | { | ||
103 | const unsigned char *c1=v1,*c2=v2; | ||
104 | int ret=0; | ||
105 | |||
106 | while(n && (ret=*c1-*c2)==0) n--,c1++,c2++; | ||
107 | |||
108 | return ret; | ||
109 | } | ||