Skip to content

Commit

Permalink
addressing bugprone-misplaced-widening-cast (loss of precision)
Browse files Browse the repository at this point in the history
  • Loading branch information
gasbytes committed Nov 11, 2024
1 parent ce596ad commit 172edaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ static int wolfSSL_BIO_MEMORY_write(WOLFSSL_BIO* bio, const void* data,
if (len == 0)
return WOLFSSL_SUCCESS; /* Return early to make logic simpler */

if (wolfSSL_BUF_MEM_grow_ex(bio->mem_buf, (size_t)(bio->wrSz + len), 0)
if (wolfSSL_BUF_MEM_grow_ex(bio->mem_buf, bio->wrSz + len, 0)
== 0) {
WOLFSSL_MSG("Error growing memory area");
return WOLFSSL_FAILURE;
Expand Down Expand Up @@ -1320,7 +1320,7 @@ size_t wolfSSL_BIO_ctrl_pending(WOLFSSL_BIO *bio)
if (pair->wrIdx > 0 && pair->wrIdx <= pair->rdIdx) {
/* in wrap around state where beginning of buffer is being
* overwritten */
return (size_t)(pair->wrSz - pair->rdIdx + pair->wrIdx);
return pair->wrSz - pair->rdIdx + pair->wrIdx;
}
else {
/* simple case where has not wrapped around */
Expand Down

0 comments on commit 172edaf

Please sign in to comment.