diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-24 20:54:28 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-24 20:54:28 +0100 |
commit | aa0fc403f7f81dedfa3fe22235aecceaf7b91e27 (patch) | |
tree | 2ae016d6fb79acf8c7e734e05bfb46bab70b1765 /src/ft_check_map_line.c | |
parent | Norme (diff) | |
download | 42-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 '')
-rw-r--r-- | src/ft_check_map_line.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/ft_check_map_line.c b/src/ft_check_map_line.c index 1009aa3..017d63a 100644 --- a/src/ft_check_map_line.c +++ b/src/ft_check_map_line.c @@ -20,16 +20,14 @@ static int8_t { if (!ft_ischarset("012NSEW ", line[i])) { - ft_strlcpy(clist->errmsg, FT_ERR_ILL_MAP, - ft_strlen(FT_ERR_ILL_MAP) + 1); + ft_sprintf(clist->errmsg, "%s", FT_ERR_ILL_MAP); return (-1); } if (ft_ischarset("NSEW", line[i])) clist->mlist->isspawn += 1; if (clist->mlist->isspawn > 1) { - ft_strlcpy(clist->errmsg, FT_ERR_MULT_SPAWN, - ft_strlen(FT_ERR_MULT_SPAWN) + 1); + ft_sprintf(clist->errmsg, "%s", FT_ERR_MULT_SPAWN); return (-1); } return (0); @@ -40,8 +38,7 @@ static int8_t { if (!ft_ischarset("1 ", line[i])) { - ft_strlcpy(clist->errmsg, FT_ERR_ILL_MAP, - ft_strlen(FT_ERR_ILL_MAP) + 1); + ft_sprintf(clist->errmsg, "%s", FT_ERR_ILL_MAP); return (-1); } return (0); @@ -69,8 +66,7 @@ static int8_t { if (line[0] != '1' || line[i - 1] != '1') { - ft_strlcpy(clist->errmsg, FT_ERR_ILL_ENTRY, - ft_strlen(FT_ERR_ILL_ENTRY) + 1); + ft_sprintf(clist->errmsg, "%s", FT_ERR_ILL_ENTRY); return (-1); } return (0); @@ -99,8 +95,7 @@ int8_t return (-1); if (ft_get_line_len(line) != clist->mlist->map_w) { - ft_strlcpy(clist->errmsg, FT_ERR_MAP_LEN, - ft_strlen(FT_ERR_MAP_LEN) + 1); + ft_sprintf(clist->errmsg, "%s", FT_ERR_MAP_LEN); return (-1); } return (0); |