Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/mem.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/crypto/mem.c b/crypto/mem.c
index 527edd93..4596472a 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -83,8 +83,6 @@ OPENSSL_MSVC_PRAGMA(warning(pop))
void *OPENSSL_realloc_clean(void *ptr, size_t old_size, size_t new_size) {
- void *ret = NULL;
-
if (ptr == NULL) {
return OPENSSL_malloc(new_size);
}
@@ -99,7 +97,7 @@ void *OPENSSL_realloc_clean(void *ptr, size_t old_size, size_t new_size) {
return NULL;
}
- ret = OPENSSL_malloc(new_size);
+ void *ret = OPENSSL_malloc(new_size);
if (ret == NULL) {
return NULL;
}
@@ -143,10 +141,9 @@ uint32_t OPENSSL_hash32(const void *ptr, size_t len) {
static const uint32_t kOffsetBasis = 2166136261u;
const uint8_t *in = ptr;
- size_t i;
uint32_t h = kOffsetBasis;
- for (i = 0; i < len; i++) {
+ for (size_t i = 0; i < len; i++) {
h ^= in[i];
h *= kPrime;
}
@@ -155,9 +152,7 @@ uint32_t OPENSSL_hash32(const void *ptr, size_t len) {
}
size_t OPENSSL_strnlen(const char *s, size_t len) {
- size_t i;
-
- for (i = 0; i < len; i++) {
+ for (size_t i = 0; i < len; i++) {
if (s[i] == 0) {
return i;
}
@@ -194,12 +189,8 @@ int OPENSSL_strncasecmp(const char *a, const char *b, size_t n) {
int BIO_snprintf(char *buf, size_t n, const char *format, ...) {
va_list args;
- int ret;
-
va_start(args, format);
-
- ret = BIO_vsnprintf(buf, n, format, args);
-
+ int ret = BIO_vsnprintf(buf, n, format, args);
va_end(args);
return ret;
}