Duplicate at most s characters of str using the OpenSSL allocator.
Declared in <openssl/crypto.h>
char*
CRYPTO_strndup(
char const* str,
size_t s,
char const* file,
int line);
Newly allocated NUL-terminated copy, or NULL on failure.
| Name | Description |
|---|---|
| str | Source bytes (NUL-terminated or truncated at s). |
| s | Maximum number of characters to copy (excluding the added NUL). |
| file | Source file name recorded with the allocation (usually FILE). |
| line | Source line recorded with the allocation (usually LINE). |