projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use asn1 callbacks for new, free and d2i
[oweals/openssl.git]
/
crypto
/
o_str.c
diff --git
a/crypto/o_str.c
b/crypto/o_str.c
index d626c98d0eb4d5102d4a80be11b90a041ea68d62..2db099333a7fd0781463f44b0023db619d0ffee0 100644
(file)
--- a/
crypto/o_str.c
+++ b/
crypto/o_str.c
@@
-57,13
+57,12
@@
*/
#include <ctype.h>
*/
#include <ctype.h>
-#include <
string
s.h>
+#include <
e_o
s.h>
#include "o_str.h"
#include "o_str.h"
-#include <openssl/e_os2.h>
int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n)
{
int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n)
{
-#if defined(OPENSSL_
SYS_VMS
)
+#if defined(OPENSSL_
IMPLEMENTS_strncasecmp
)
while (*str1 && *str2 && n)
{
int res = toupper(*str1) - toupper(*str2);
while (*str1 && *str2 && n)
{
int res = toupper(*str1) - toupper(*str2);
@@
-79,20
+78,28
@@
int OPENSSL_strncasecmp(const char *str1, const char *str2, size_t n)
if (*str2)
return -1;
return 0;
if (*str2)
return -1;
return 0;
-#elif defined(OPENSSL_SYS_WINDOWS)
- return _strnicmp(str1, str2, n);
#else
#else
+ /* Recursion hazard warning! Whenever strncasecmp is #defined as
+ * OPENSSL_strncasecmp, OPENSSL_IMPLEMENTS_strncasecmp must be
+ * defined as well. */
return strncasecmp(str1, str2, n);
#endif
}
int OPENSSL_strcasecmp(const char *str1, const char *str2)
{
return strncasecmp(str1, str2, n);
#endif
}
int OPENSSL_strcasecmp(const char *str1, const char *str2)
{
-#if defined(OPENSSL_SYS_VMS)
- return OSSL_strncasecmp(str1, str2, (size_t)-1);
-#elif defined(OPENSSL_SYS_WINDOWS)
- return _stricmp(str1, str2);
+#if defined(OPENSSL_IMPLEMENTS_strncasecmp)
+ return OPENSSL_strncasecmp(str1, str2, (size_t)-1);
#else
return strcasecmp(str1, str2);
#endif
}
#else
return strcasecmp(str1, str2);
#endif
}
+int OPENSSL_memcmp(const void *v1,const void *v2,size_t n)
+ {
+ const unsigned char *c1=v1,*c2=v2;
+ int ret=0;
+
+ while(n && (ret=*c1-*c2)==0) n--,c1++,c2++;
+
+ return ret;
+ }