added usage

This commit is contained in:
asus
2024-01-09 15:14:40 +01:00
parent cf988ebbe6
commit 3c0a459b64
8 changed files with 7 additions and 2 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
+1 -1
Submodule libft updated: d622367cfd...f32d4bbc96
+6 -1
View File
@@ -75,13 +75,18 @@ void init_fdf(t_fdf *fdf)
draw_image(fdf); draw_image(fdf);
} }
int usage() {
write(2, "usage:\nneed one argument : ./fdf maps/<map>.fdf\n", 48);
return (0);
}
int main(int ac, char **av) int main(int ac, char **av)
{ {
t_fdf *fdf; t_fdf *fdf;
int fd; int fd;
if (ac != 2) if (ac != 2)
return (0); return usage();
fdf = malloc(sizeof(t_fdf)); fdf = malloc(sizeof(t_fdf));
fd = open(av[1], O_RDONLY); fd = open(av[1], O_RDONLY);
if (!fd || !fdf) if (!fd || !fdf)