Libft disc

Libft

C project · library, libc

My own C standard library — the foundation every later 42 project is built on.

Open it in the console View the code on GitHub Resume (PDF) LinkedIn

The problem

Write my own C standard library, used by every later 42 project.

What I built

The hard part

Failing halfway without leaking. If ft_split ran out of memory partway through, the words already copied and the array itself were lost; it now frees everything it built before returning NULL, and ft_lstmap frees the content f just made when the new node can't be allocated. ft_calloc checks nmemb * size for overflow before calling malloc, so a huge request returns NULL instead of a smaller buffer.

Built with

More projects