aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-04 16:50:35 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-04 16:50:35 +0100
commit68de7def46a05ebe00d28b2812842186467b8c64 (patch)
tree9c6db63e5b7804f2adac316ee17b64080263a152
parentdefines (diff)
download42-cub3d-68de7def46a05ebe00d28b2812842186467b8c64.tar.gz
42-cub3d-68de7def46a05ebe00d28b2812842186467b8c64.tar.bz2
42-cub3d-68de7def46a05ebe00d28b2812842186467b8c64.tar.xz
42-cub3d-68de7def46a05ebe00d28b2812842186467b8c64.tar.zst
42-cub3d-68de7def46a05ebe00d28b2812842186467b8c64.zip
cool sprintf
-rw-r--r--src/ft_save_to_bmp.c12
1 files changed, 12 insertions, 0 deletions
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 <libft.h>
#include <cub3d.h>
+#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
+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)
{