From e4c19252e796e1c6753f5b3b35f2c54601ac6982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Kr=C3=BCger?= Date: Sat, 25 Oct 2025 17:23:41 +0200 Subject: [PATCH 1/4] configure my libft folder --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 53782a3..3c32e0e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .DEFAULT_GOAL := a UTILS = $(addprefix utils/, sigsegv.cpp color.cpp check.cpp leaks.cpp) PARENT_DIR = $(shell dirname $(shell pwd)) -LIBFT_PATH = $(PARENT_DIR) +LIBFT_PATH = $(PARENT_DIR)/libft TESTS_PATH = tests/ MANDATORY = memset bzero memcpy memmove memchr memcmp strlen isalpha isdigit isalnum \ isascii isprint toupper tolower strchr strrchr strncmp strlcpy strlcat strnstr \ From d5516086265f247d8e20e3b041bf2db1e52618a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Kr=C3=BCger?= Date: Tue, 28 Oct 2025 23:36:46 +0100 Subject: [PATCH 2/4] revert Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3c32e0e..53782a3 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .DEFAULT_GOAL := a UTILS = $(addprefix utils/, sigsegv.cpp color.cpp check.cpp leaks.cpp) PARENT_DIR = $(shell dirname $(shell pwd)) -LIBFT_PATH = $(PARENT_DIR)/libft +LIBFT_PATH = $(PARENT_DIR) TESTS_PATH = tests/ MANDATORY = memset bzero memcpy memmove memchr memcmp strlen isalpha isdigit isalnum \ isascii isprint toupper tolower strchr strrchr strncmp strlcpy strlcat strnstr \ From bf57172f94310fd6c33ff6c579b911d20cb3533a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Kr=C3=BCger?= Date: Tue, 28 Oct 2025 23:38:17 +0100 Subject: [PATCH 3/4] strtrim test to not remove chars except for the end and start --- tests/ft_strtrim_test.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ft_strtrim_test.cpp b/tests/ft_strtrim_test.cpp index ec097de..c11d79a 100644 --- a/tests/ft_strtrim_test.cpp +++ b/tests/ft_strtrim_test.cpp @@ -46,8 +46,12 @@ int main(void) s = ft_strtrim("abcdba", "acb"); /* opsec-infosec 15 */ check(!strcmp(s, "d")); - /* opsec-infosec 16 */ mcheck(s, 2); free(s); showLeaks(); + /* opsec-infosec 16 */ mcheck(s, 2); free(s); showLeaks(); + s = ft_strtrim("x xx[h oax],x,x x", "x, "); + /* opsec-infosec 17 */ check(!strcmp(s, "[h oax]")); + /* opsec-infosec 18 */ mcheck(s, 8); free(s); showLeaks(); + write(1, "\n", 1); return (0); } From 12e3059449723d7030183b536bcae4d20e66ded2 Mon Sep 17 00:00:00 2001 From: Ignatz Date: Sun, 9 Nov 2025 23:04:14 +0100 Subject: [PATCH 4/4] fix some compiler errors for your clang version --- Makefile | 4 ++-- tests/ft_putchar_fd_test.cpp | 2 +- tests/ft_putendl_fd_test.cpp | 2 +- tests/ft_putstr_fd_test.cpp | 2 +- tests/ft_striteri_test.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 53782a3..bc0f25b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .DEFAULT_GOAL := a UTILS = $(addprefix utils/, sigsegv.cpp color.cpp check.cpp leaks.cpp) PARENT_DIR = $(shell dirname $(shell pwd)) -LIBFT_PATH = $(PARENT_DIR) +LIBFT_PATH = $(PARENT_DIR)/libft TESTS_PATH = tests/ MANDATORY = memset bzero memcpy memmove memchr memcmp strlen isalpha isdigit isalnum \ isascii isprint toupper tolower strchr strrchr strncmp strlcpy strlcat strnstr \ @@ -11,7 +11,7 @@ BONUS = lstnew lstadd_front lstsize lstlast lstadd_back lstdelone lstclear lst VSOPEN = $(addprefix vs, $(MANDATORY)) $(addprefix vs, $(BONUS)) CC = clang++ -CFLAGS = -g3 -ldl -gdwarf-4 -std=c++11 -I utils/ -I$(LIBFT_PATH) +CFLAGS = -g3 -ldl -gdwarf-4 -std=c++11 -I utils/ -I$(LIBFT_PATH) -Wno-unused-result UNAME = $(shell uname -s) ifeq ($(UNAME), Linux) VALGRIND = valgrind -q --leak-check=full diff --git a/tests/ft_putchar_fd_test.cpp b/tests/ft_putchar_fd_test.cpp index 8d6e49d..11411a6 100644 --- a/tests/ft_putchar_fd_test.cpp +++ b/tests/ft_putchar_fd_test.cpp @@ -19,7 +19,7 @@ int main(void) signal(SIGSEGV, sigsegv); title("ft_putchar_fd\t: ") - int fd = open("tripouille", O_RDWR | O_CREAT); + int fd = open("tripouille", O_RDWR | O_CREAT, 0600); ft_putchar_fd('a', fd); lseek(fd, SEEK_SET, 0); char s[10] = {0}; read(fd, s, 2); diff --git a/tests/ft_putendl_fd_test.cpp b/tests/ft_putendl_fd_test.cpp index bd68d95..ad17eab 100644 --- a/tests/ft_putendl_fd_test.cpp +++ b/tests/ft_putendl_fd_test.cpp @@ -19,7 +19,7 @@ int main(void) signal(SIGSEGV, sigsegv); title("ft_putendl_fd\t: ") - int fd = open("tripouille", O_RDWR | O_CREAT); + int fd = open("tripouille", O_RDWR | O_CREAT, 0600); ft_putendl_fd((char*)"42", fd); lseek(fd, SEEK_SET, 0); char s[10] = {0}; read(fd, s, 4); diff --git a/tests/ft_putstr_fd_test.cpp b/tests/ft_putstr_fd_test.cpp index 60ec7ec..4a57452 100644 --- a/tests/ft_putstr_fd_test.cpp +++ b/tests/ft_putstr_fd_test.cpp @@ -19,7 +19,7 @@ int main(void) signal(SIGSEGV, sigsegv); title("ft_putstr_fd\t: ") - int fd = open("tripouille", O_RDWR | O_CREAT); + int fd = open("tripouille", O_RDWR | O_CREAT, 0600); ft_putstr_fd((char*)"42", fd); lseek(fd, SEEK_SET, 0); char s[10] = {0}; read(fd, s, 3); diff --git a/tests/ft_striteri_test.cpp b/tests/ft_striteri_test.cpp index d0fcd60..97913eb 100644 --- a/tests/ft_striteri_test.cpp +++ b/tests/ft_striteri_test.cpp @@ -41,4 +41,4 @@ int main(void) } write(1, "\n", 1); return (0); -} \ No newline at end of file +}