aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_colors.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-24 20:54:28 +0100
committerRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-02-24 20:54:28 +0100
commitaa0fc403f7f81dedfa3fe22235aecceaf7b91e27 (patch)
tree2ae016d6fb79acf8c7e734e05bfb46bab70b1765 /src/ft_get_colors.c
parentNorme (diff)
download42-cub3d-aa0fc403f7f81dedfa3fe22235aecceaf7b91e27.tar.gz
42-cub3d-aa0fc403f7f81dedfa3fe22235aecceaf7b91e27.tar.bz2
42-cub3d-aa0fc403f7f81dedfa3fe22235aecceaf7b91e27.tar.xz
42-cub3d-aa0fc403f7f81dedfa3fe22235aecceaf7b91e27.tar.zst
42-cub3d-aa0fc403f7f81dedfa3fe22235aecceaf7b91e27.zip
sprintf is bav
Diffstat (limited to 'src/ft_get_colors.c')
-rw-r--r--src/ft_get_colors.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/ft_get_colors.c b/src/ft_get_colors.c
index f54fabc..96be925 100644
--- a/src/ft_get_colors.c
+++ b/src/ft_get_colors.c
@@ -30,8 +30,7 @@ static int8_t
if (i != ft_strlen(num[j]))
{
ft_free_words(num);
- ft_strlcpy(clist->errmsg, FT_ERR_COLOR_ALPHA,
- ft_strlen(FT_ERR_COLOR_ALPHA) + 1);
+ ft_sprintf(clist->errmsg, "%s", FT_ERR_COLOR_ALPHA);
return (-1);
}
i = 0;
@@ -46,8 +45,7 @@ static int8_t
if (ft_atoi(num[0]) > 255 || ft_atoi(num[1]) > 255
|| ft_atoi(num[2]) > 255)
{
- ft_strlcpy(clist->errmsg, FT_ERR_COLOR_MAX,
- ft_strlen(FT_ERR_COLOR_MAX) + 1);
+ ft_sprintf(clist->errmsg, "%s", FT_ERR_COLOR_MAX);
ft_free_words(num);
return (-1);
}
@@ -59,8 +57,7 @@ static int8_t
{
if (!num[0] || !num[1] || !num[2] || num[3])
{
- ft_strlcpy(clist->errmsg, FT_ERR_COLOR_ARGS,
- ft_strlen(FT_ERR_COLOR_ARGS) + 1);
+ ft_sprintf(clist->errmsg, "%s", FT_ERR_COLOR_ARGS);
ft_free_words(num);
return (-1);
}
@@ -74,13 +71,12 @@ int8_t
if (!(*words) || !words[1] || words[2])
{
- ft_strlcpy(clist->errmsg, FT_ERR_ARGS, ft_strlen(FT_ERR_ARGS) + 1);
+ ft_sprintf(clist->errmsg, "%s", FT_ERR_ARGS);
return (-1);
}
if (!(num = ft_split(words[1], ',')))
{
- ft_strlcpy(clist->errmsg, FT_ERR_ALLOCATE,
- ft_strlen(FT_ERR_ALLOCATE) + 1);
+ ft_sprintf(clist->errmsg, "%s", FT_ERR_ALLOCATE);
return (-1);
}
if (ft_check_nums_amount(num, clist) < 0)
@@ -103,13 +99,12 @@ int8_t
if (!(*words) || !words[1] || words[2])
{
- ft_strlcpy(clist->errmsg, FT_ERR_ARGS, ft_strlen(FT_ERR_ARGS) + 1);
+ ft_sprintf(clist->errmsg, "%s", FT_ERR_ARGS);
return (-1);
}
if (!(num = ft_split(words[1], ',')))
{
- ft_strlcpy(clist->errmsg, FT_ERR_ALLOCATE,
- ft_strlen(FT_ERR_ALLOCATE) + 1);
+ ft_sprintf(clist->errmsg, "%s", FT_ERR_ALLOCATE);
return (-1);
}
if (ft_check_nums_amount(num, clist) < 0)