Skip to content

Commit

Permalink
size_t for buffer functions.
Browse files Browse the repository at this point in the history
Change BUF_MEM_grow and BUF_MEM_grow_clean to return size_t.
Reviewed-by: Richard Levitte <levitte@openssl.org>
  • Loading branch information
snhenson committed Feb 13, 2015
1 parent d5ec8ef commit e5bf3c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crypto/bio/bss_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static int mem_write(BIO *b, const char *in, int inl)

BIO_clear_retry_flags(b);
blen = bm->length;
if (BUF_MEM_grow_clean(bm, blen + inl) != (blen + inl))
if (BUF_MEM_grow_clean(bm, blen + inl) == 0)
goto end;
memcpy(&(bm->data[blen]), in, inl);
ret = inl;
Expand Down
4 changes: 2 additions & 2 deletions crypto/buffer/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void BUF_MEM_free(BUF_MEM *a)
OPENSSL_free(a);
}

int BUF_MEM_grow(BUF_MEM *str, size_t len)
size_t BUF_MEM_grow(BUF_MEM *str, size_t len)
{
char *ret;
size_t n;
Expand Down Expand Up @@ -130,7 +130,7 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len)
return (len);
}

int BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len)
{
char *ret;
size_t n;
Expand Down
4 changes: 2 additions & 2 deletions crypto/buffer/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ struct buf_mem_st {

BUF_MEM *BUF_MEM_new(void);
void BUF_MEM_free(BUF_MEM *a);
int BUF_MEM_grow(BUF_MEM *str, size_t len);
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
size_t BUF_strnlen(const char *str, size_t maxlen);
char *BUF_strdup(const char *str);
char *BUF_strndup(const char *str, size_t siz);
Expand Down

0 comments on commit e5bf3c9

Please sign in to comment.