Commit graph

76 commits

Author SHA1 Message Date
Khaïs COLIN
6236107bd4 fix(ft_strchr): c was not cast to char for check agains \0 2024-10-23 10:35:01 +02:00
Khaïs COLIN
88a147fd0f ft_strncmp: work correctly if len(s1) == n && len(s2) > n 2024-10-22 12:28:39 +02:00
Khaïs COLIN
bf690a960c ft_memmove: do not try to copy to or from null 2024-10-22 12:15:48 +02:00
Khaïs COLIN
34a548bd78 ft_memcpy: do not try to copy to or from null 2024-10-22 12:10:08 +02:00
Khaïs COLIN
1d5123bd4a Makefile: make bonus rule phony 2024-10-22 11:36:47 +02:00
Khaïs COLIN
d9808a974a ft_lstmap: initial implementation 2024-10-21 17:37:06 +02:00
Khaïs COLIN
bece5aec9d ft_lstiter: initial implementation 2024-10-21 17:13:04 +02:00
Khaïs COLIN
47904658d0 Makefile: more robust clean rule 2024-10-21 17:10:17 +02:00
Khaïs COLIN
f9e81f344c ft_lstclear: initial implementation 2024-10-21 15:18:48 +02:00
Khaïs COLIN
3f2e2ae0f2 ft_lstdelone: initial implementation 2024-10-21 14:52:20 +02:00
Khaïs COLIN
d971555797 ft_lstnew: showcase how to use int as content 2024-10-21 13:39:00 +02:00
Khaïs COLIN
c3a67f660b ft_lstadd_back: initial implementation 2024-10-21 13:32:14 +02:00
Khaïs COLIN
4709b5929a ft_lstlast: fix segfault when lst=NULL 2024-10-21 13:31:45 +02:00
Khaïs COLIN
d9097ecd53 ft_lstsize: norm error fixed 2024-10-21 12:16:09 +02:00
Khaïs COLIN
a872beadb9 ft_lstlast: initial implementation 2024-10-21 12:12:35 +02:00
Khaïs COLIN
7acdc05a62 ft_lstsize: initial implementation 2024-10-21 11:50:55 +02:00
Khaïs COLIN
a620c3606d ft_lstadd_front: initial implementation 2024-10-21 11:40:47 +02:00
Khaïs COLIN
8777bfc3c3 ft_lstnew: initial implementation 2024-10-21 11:28:06 +02:00
Khaïs COLIN
1126640edc Revert "Makefile: separate sources by allowed functions"
This reverts commit 55ee770fa8.
2024-10-21 11:14:20 +02:00
Khaïs COLIN
2f2623c7bb libft.a: add s_list structure for bonus 2024-10-21 11:12:31 +02:00
Khaïs COLIN
eeac617b02 Makefile: fix rule re not working reliably with multiple jobs 2024-10-21 10:50:49 +02:00
Khaïs COLIN
55ee770fa8 Makefile: separate sources by allowed functions 2024-10-21 10:46:19 +02:00
Khaïs COLIN
fb498eca6d Makefile: do not set compiler 2024-10-19 18:39:54 +02:00
Khaïs COLIN
26618f40b1 ft_substr: don't allocate too much mem + handle start outside of str 2024-10-19 18:36:17 +02:00
Khaïs COLIN
29f2cc104a ft_calloc: do not memset if malloc returns NULL 2024-10-19 18:13:22 +02:00
Khaïs COLIN
afcddc5e14 ft_atoi: correctly handle +/- at start 2024-10-19 18:11:30 +02:00
Khaïs COLIN
9b93b1c909 ft_atoi: fix leading whitespace parsing 2024-10-18 18:01:46 +02:00
Khaïs COLIN
045f9a9012 ft_strncmp: fix returning wrong value with n=0 2024-10-18 17:55:41 +02:00
Khaïs COLIN
6f22d1eb36 ft_strrchr: fix 2 small bugs
1. Compairing was done with ints, not bytes
2. did not correctly give pointer to null terminator
2024-10-18 17:47:30 +02:00
Khaïs COLIN
d517a05f90 ft_strchr: fix 2 small bugs
1. Compairing was done with ints, not bytes
2. did not correctly give pointer to null terminator
2024-10-18 17:44:41 +02:00
Khaïs COLIN
99bd5cc4cd ignore libftTester 2024-10-18 17:38:48 +02:00
Khaïs COLIN
07704a2d59 ft_putnbr_fd: initial implementation
NOTE: When compiling with gcc and checking the produced library with nm,
we get the following output:

ft_putnbr_fd.o:
                 U ft_putchar_fd
0000000000000000 T ft_putnbr_fd
                 U __stack_chk_fail
                 U write

As you can see, there is an undefined function that is used in this
object file, "__stack_chk_fail". This function is not allowed by the
subject! Only write is allowed!

I am told that the moulinette compiles with clang, which does not
exhibit this behaviour. However, it may be that gcc is used instead,
which may cause my project to fail. (Also, an evaluator may mark me down
for that). I don't want either of those two things to happen, so I will
code another implementation which uses recursion, as this kind of
impelmentation does not seem to cause this behaviour with gcc.

Thanks to tchampio for his help debugging this issue.
2024-10-18 16:31:16 +02:00
Khaïs COLIN
b1f1b8a13f ft_putendl_fd: initial implementation 2024-10-18 15:25:40 +02:00
Khaïs COLIN
81343980be ft_putstr_fd: initial implementation 2024-10-18 15:20:56 +02:00
Khaïs COLIN
28cadf55f1 ft_putchar_fd: initial implementation 2024-10-18 14:30:13 +02:00
Khaïs COLIN
6a186f7527 ft_striteri: initial implementation 2024-10-18 12:11:55 +02:00
Khaïs COLIN
f2f363518c ft_strmapi: initial implementation 2024-10-18 11:55:40 +02:00
Khaïs COLIN
08bae77518 ft_itoa: initial implementation
I wrote this in a single session, with 0 errors on the first try!
2024-10-17 17:37:10 +02:00
Khaïs COLIN
d1b5c7b687 ft_split: initial implementation 2024-10-17 17:02:35 +02:00
Khaïs COLIN
5ec841de7f ft_strtrim: initial implementation 2024-10-17 14:11:16 +02:00
Khaïs COLIN
c795a9bab1 ft_calloc: correctly set allocated memory to zero 2024-10-17 13:53:44 +02:00
Khaïs COLIN
d8ec79480f ft_strjoin: initial implementation 2024-10-17 12:11:30 +02:00
Khaïs COLIN
7d896b939c ft_substr: initial implementation 2024-10-17 12:00:30 +02:00
Khaïs COLIN
a20611c09a ft_strdup: initial implementation 2024-10-17 11:03:37 +02:00
Khaïs COLIN
df37e074f3 ft_strlcpy: fix incorrect name 2024-10-17 10:43:33 +02:00
Khaïs COLIN
a38e9e5f94 ft_calloc: initial implementation 2024-10-17 10:42:43 +02:00
Khaïs COLIN
fce032ce2f ft_atoi: initial implementation 2024-10-16 16:14:58 +02:00
Khaïs COLIN
0a1e2f2b37 ft_strnstr: initial implementation 2024-10-16 15:59:48 +02:00
Khaïs COLIN
1c3df31518 ft_memcmp: initial implementation
also fix a small clarity issue in ft_strncmp
2024-10-16 15:34:30 +02:00
Khaïs COLIN
b81ad331b5 chore: use correct size_t instead of t_size 2024-10-16 15:20:28 +02:00