mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-27 00:41:57 +00:00
FIX: exit if str is null
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/01/08 14:30:38 by dgaillet #+# #+# */
|
/* Created: 2026/01/08 14:30:38 by dgaillet #+# #+# */
|
||||||
/* Updated: 2026/01/09 12:05:56 by dgaillet ### ########lyon.fr */
|
/* Updated: 2026/01/09 14:55:16 by dgaillet ### ########lyon.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -17,6 +17,6 @@ void secure_write(int fd, char *str, int len)
|
|||||||
{
|
{
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
return ;
|
return ;
|
||||||
if (write(fd, str, len) < 0)
|
if (!str || write(fd, str, len) < 0)
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user