ret = BUF_MEM_new();
if (ret != NULL)
ret->flags = flags;
- return (ret);
+ return ret;
}
BUF_MEM *BUF_MEM_new(void)
ret = OPENSSL_zalloc(sizeof(*ret));
if (ret == NULL) {
BUFerr(BUF_F_BUF_MEM_NEW, ERR_R_MALLOC_FAILURE);
- return (NULL);
+ return NULL;
}
- return (ret);
+ return ret;
}
void BUF_MEM_free(BUF_MEM *a)
str->data = NULL;
}
}
- return (ret);
+ return ret;
}
size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
if (str->length >= len) {
str->length = len;
- return (len);
+ return len;
}
if (str->max >= len) {
if (str->data != NULL)
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
- return (len);
+ return len;
}
/* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
if (len > LIMIT_BEFORE_EXPANSION) {
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
}
- return (len);
+ return len;
}
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
if (str->data != NULL)
memset(&str->data[len], 0, str->length - len);
str->length = len;
- return (len);
+ return len;
}
if (str->max >= len) {
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
- return (len);
+ return len;
}
/* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */
if (len > LIMIT_BEFORE_EXPANSION) {
memset(&str->data[str->length], 0, len - str->length);
str->length = len;
}
- return (len);
+ return len;
}
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t size)