projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor fixes for Windows
[openssl.git]
/
crypto
/
o_str.c
diff --git
a/crypto/o_str.c
b/crypto/o_str.c
index beabec0ddc14a75b5ca3dab3a97aa93818695ae2..a8357691ad66e9b668e28acad5f3b45eddab8fb8 100644
(file)
--- a/
crypto/o_str.c
+++ b/
crypto/o_str.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 2003-201
6
The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2003-201
7
The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@
-7,9
+7,8
@@
* https://www.openssl.org/source/license.html
*/
* https://www.openssl.org/source/license.html
*/
-#include
<ctype.h>
+#include
"e_os.h"
#include <limits.h>
#include <limits.h>
-#include <e_os.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include "internal/o_str.h"
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include "internal/o_str.h"
@@
-28,14
+27,12
@@
int OPENSSL_memcmp(const void *v1, const void *v2, size_t n)
char *CRYPTO_strdup(const char *str, const char* file, int line)
{
char *ret;
char *CRYPTO_strdup(const char *str, const char* file, int line)
{
char *ret;
- size_t size;
if (str == NULL)
return NULL;
if (str == NULL)
return NULL;
- size = strlen(str) + 1;
- ret = CRYPTO_malloc(size, file, line);
+ ret = CRYPTO_malloc(strlen(str) + 1, file, line);
if (ret != NULL)
if (ret != NULL)
-
memcpy(ret, str, size
);
+
strcpy(ret, str
);
return ret;
}
return ret;
}
@@
-193,7
+190,7
@@
unsigned char *OPENSSL_hexstr2buf(const char *str, long *len)
*/
char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
{
*/
char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
{
-
const static
char hexdig[] = "0123456789ABCDEF";
+
static const
char hexdig[] = "0123456789ABCDEF";
char *tmp, *q;
const unsigned char *p;
int i;
char *tmp, *q;
const unsigned char *p;
int i;
@@
-227,7
+224,8
@@
int openssl_strerror_r(int errnum, char *buf, size_t buflen)
return !strerror_s(buf, buflen, errnum);
#elif defined(_GNU_SOURCE)
return strerror_r(errnum, buf, buflen) != NULL;
return !strerror_s(buf, buflen, errnum);
#elif defined(_GNU_SOURCE)
return strerror_r(errnum, buf, buflen) != NULL;
-#elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
+#elif (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \
+ (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600)
/*
* We can use "real" strerror_r. The OpenSSL version differs in that it
* gives 1 on success and 0 on failure for consistency with other OpenSSL
/*
* We can use "real" strerror_r. The OpenSSL version differs in that it
* gives 1 on success and 0 on failure for consistency with other OpenSSL