From 68de7def46a05ebe00d28b2812842186467b8c64 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 4 Mar 2020 16:50:35 +0100 Subject: cool sprintf --- src/ft_save_to_bmp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ft_save_to_bmp.c b/src/ft_save_to_bmp.c index b570307..5d66dd2 100644 --- a/src/ft_save_to_bmp.c +++ b/src/ft_save_to_bmp.c @@ -12,9 +12,21 @@ #include #include +#include #include #include +static char + *ft_set_file_name(t_map *ml) +{ + char *str; + + if (!(str = (char*)malloc((ft_strlen(ft_strrchr(ml->filename), '/') + + 1) * sizeof(char)))) + return (NULL); + ft_sprintf(str, "%s", ft_strrchr(ml->filename)); +} + static int8_t ft_convert_image_to_bmp(t_bmp_file bmp_file, void *img, t_cub *cl) { -- cgit v1.2.3