Open Enclave
char* oe_host_strndup ( const char *  str,
size_t  n 
)

Make a heap copy of a string.

This function allocates memory on the host's heap, copies no more than n bytes from the str parameter to that memory, and returns a pointer to the newly allocated memory.

Parameters
strThe string to be copied.
nThe number of characters to be copied.
Returns
A pointer to the newly allocated string or NULL if unable to allocate the storage.