Null terminating char array

This commit is contained in:
Timo Schmidt 2023-03-18 05:01:39 +01:00
parent f7675d98df
commit d902e5d22b
2 changed files with 8 additions and 7 deletions

3
main.c
View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/18 02:09:32 by tischmid #+# #+# */
/* Updated: 2023/03/18 04:34:02 by tischmid ### ########.fr */
/* Updated: 2023/03/18 04:52:15 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,6 +26,7 @@ int main(int argc, char *argv[])
ft_putstr("\033[31mWrong number of arguments (expected 2 got ");
ft_putnbr(argc - 1);
ft_putstr(")\033[m\n");
ft_putstr("\033[32mUsage: ./rush00 [width] [height]\033[m\n");
return (1);
}
width = ft_atoi(argv[1]);

View File

@ -6,7 +6,7 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/18 02:10:24 by tischmid #+# #+# */
/* Updated: 2023/03/18 04:04:42 by tischmid ### ########.fr */
/* Updated: 2023/03/18 05:01:27 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,27 +17,27 @@ const char g_inside = ' ';
// Rush 00
// clockwise, starting from top left
const char g_corners[] = {'o', 'o', 'o', 'o'};
const char g_corners[] = {'o', 'o', 'o', 'o', '\0'};
const char g_horizontal = '-';
const char g_vertical = '|';
// Rush 01
// const char g_corners[] = {'/', '\\', '/', '\\'};
// const char g_corners[] = {'/', '\\', '/', '\\', '\0'};
// const char g_horizontal = '*';
// const char g_vertical = '*';
// Rush 02
// const char g_corners[] = {'A', 'A', 'C', 'C'};
// const char g_corners[] = {'A', 'A', 'C', 'C', '\0'};
// const char g_horizontal = 'B';
// const char g_vertical = 'B';
// Rush 03
// const char g_corners[] = {'A', 'C', 'C', 'A'};
// const char g_corners[] = {'A', 'C', 'C', 'A', '\0'};
// const char g_horizontal = 'B';
// const char g_vertical = 'B';
// Rush 04
// const char g_corners[] = {'A', 'C', 'A', 'C'};
// const char g_corners[] = {'A', 'C', 'A', 'C', '\0'};
// const char g_horizontal = 'B';
// const char g_vertical = 'B';