aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rw-r--r--libft/Makefile14
-rw-r--r--src/ft_select_get.c2
3 files changed, 22 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 59de80d..7f06fa7 100644
--- a/Makefile
+++ b/Makefile
@@ -98,10 +98,18 @@ endif
#==================================================================================================#
#------------------------------------------ Compiler ----------------------------------------------#
#==================================================================================================#
-DEBUG = -glldb
+ifeq (${OS}, Darwin)
+ DEBUG = -glldb
+else
+ DEBUG = -ggdb
+endif
FSANITIZE = -fsanitize=address
#--------------------------------------------------------------------------------------------------#
-CC = clang
+ifeq (${OS}, Darwin)
+ CC = clang
+else
+ CC = gcc
+endif
#--------------------------------------------------------------------------------------------------#
CFLAGS = -std=c89
CFLAGS += -Wall
diff --git a/libft/Makefile b/libft/Makefile
index 35c2b88..1f93f13 100644
--- a/libft/Makefile
+++ b/libft/Makefile
@@ -119,19 +119,27 @@ USER = $(shell w | grep tty7 | awk '{print $$1}')
#==============================================================================#
#-------------------------------- Compiler ------------------------------------#
#==============================================================================#
-DEBUG = -glldb
+ifeq (${OS}, Darwin)
+ DEBUG = -glldb
+else
+ DEBUG = -ggdb
+endif
FSANITIZE = -fsanitize=address
#------------------------------------------------------------------------------#
-CC = clang
+ifeq (${OS}, Darwin)
+ CC = clang
+else
+ CC = gcc
+endif
#------------------------------------------------------------------------------#
CFLAGS = -std=c89
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Werror
CFLAGS += -pedantic
-CFLAGS += ${DEBUG}
#------------------------------------------------------------------------------#
ifdef ASAN
+ CFLAGS += ${DEBUG}
CFLAGS += ${FSANITIZE}
endif
#------------------------------------------------------------------------------#
diff --git a/src/ft_select_get.c b/src/ft_select_get.c
index c73ed06..8005eb7 100644
--- a/src/ft_select_get.c
+++ b/src/ft_select_get.c
@@ -73,7 +73,7 @@ static int8_t
ft_sprintf(ref[8], "L");
ft_sprintf(ref[9], "LT");
ft_sprintf(ref[10], "MU");
- ft_sprintf(ref[11], "");
+ ft_bzero(ref[11], 3);
if (words[0][0] == ' ' || words[0][0] == '1')
return (12);
ret = 0;