BUF_strndup: tidy

Fix comment, add another overflow check, tidy style

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit de8883e11b)
(cherry picked from commit f5afe9ce3f)
This commit is contained in:
Emilia Kasper
2015-09-17 13:27:05 +02:00
parent 6905187488
commit e56c77b8ee
2 changed files with 9 additions and 9 deletions

View File

@@ -87,8 +87,8 @@ int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
char *BUF_strdup(const char *str);
/*
* Returns a pointer to a new string which is a duplicate of the string |str|,
* but guarantees to never read past the first |siz| bytes of |str|.
* Like strndup, but in addition, explicitly guarantees to never read past the
* first |siz| bytes of |str|.
*/
char *BUF_strndup(const char *str, size_t siz);