summaryrefslogtreecommitdiffstats
path: root/crypto/buffer
diff options
context:
space:
mode:
authorBen Laurie <ben@links.org>2014-05-21 13:03:02 +0200
committerBen Laurie <ben@links.org>2014-05-21 13:03:02 +0200
commit12f1b3e79fdca6338675fb090ed307b3619e2ece (patch)
treea15e32b6ea366526bec729a1406508680f09730b /crypto/buffer
parentImplement BUF_strnlen() and use it instead of strlen(). (diff)
downloadopenssl-12f1b3e79fdca6338675fb090ed307b3619e2ece.tar.xz
openssl-12f1b3e79fdca6338675fb090ed307b3619e2ece.zip
Remove redundant test.
Diffstat (limited to 'crypto/buffer')
-rw-r--r--crypto/buffer/buf_str.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/buffer/buf_str.c b/crypto/buffer/buf_str.c
index 58028ebac7..35e4a2e789 100644
--- a/crypto/buffer/buf_str.c
+++ b/crypto/buffer/buf_str.c
@@ -81,13 +81,10 @@ char *BUF_strdup(const char *str)
char *BUF_strndup(const char *str, size_t siz)
{
char *ret;
- size_t len;
if (str == NULL) return(NULL);
- len = BUF_strnlen(str, siz);
- if (siz > len)
- siz = len;
+ siz = BUF_strnlen(str, siz);
ret=OPENSSL_malloc(siz+1);
if (ret == NULL)