42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
my_malloc_strndup.c File Reference

The file containing the my_malloc_strndup function. More...

#include "mymemory.h"

Functions

char * my_malloc_strndup (char const *src, int n)
 Duplicates a string with a defined size with my_malloc.
 

Detailed Description

The file containing the my_malloc_strndup function.

Author
Nicolas TORO

Function Documentation

◆ my_malloc_strndup()

char * my_malloc_strndup ( char const * src,
int n )

Duplicates a string with a defined size with my_malloc.

Note
The duplicated string must be free only with my_free
Parameters
srcThe string to duplicate
nThe size of the string
Returns
char* A pointer to the duplicated string
Author
Nicolas TORO