提交 21b0fa91 编写于 作者: E Emilia Kasper

Document BUF_strnlen

Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 58e3457a
...@@ -32,6 +32,8 @@ standard C library equivalents ...@@ -32,6 +32,8 @@ standard C library equivalents
size_t BUF_strlcat(char *dst, const char *src, size_t size); size_t BUF_strlcat(char *dst, const char *src, size_t size);
size_t BUF_strnlen(const char *str, size_t maxlen);
=head1 DESCRIPTION =head1 DESCRIPTION
The buffer library handles simple character arrays. Buffers are used for The buffer library handles simple character arrays. Buffers are used for
...@@ -50,11 +52,11 @@ BUF_MEM_grow() changes the size of an already existing buffer to ...@@ -50,11 +52,11 @@ BUF_MEM_grow() changes the size of an already existing buffer to
B<len>. Any data already in the buffer is preserved if it increases in B<len>. Any data already in the buffer is preserved if it increases in
size. size.
BUF_strdup(), BUF_strndup(), BUF_memdup(), BUF_strlcpy() and BUF_strdup(), BUF_strndup(), BUF_memdup(), BUF_strlcpy(),
BUF_strlcat() are equivalents of the standard C library functions. The BUF_strlcat() and BUF_strnlen are equivalents of the standard C
dup() functions use OPENSSL_malloc() underneath and so should be used library functions. The dup() functions use OPENSSL_malloc() underneath
in preference to the standard library for memory leak checking or and so should be used in preference to the standard library for memory
replacing the malloc() function. leak checking or replacing the malloc() function.
Memory allocated from these functions should be freed up using the Memory allocated from these functions should be freed up using the
OPENSSL_free() function. OPENSSL_free() function.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册