mirror of
https://github.com/DavidGailleton/42-Push_Swap.git
synced 2026-01-26 16:31:58 +00:00
23 lines
1.0 KiB
C
23 lines
1.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* secure_write.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/01/08 14:30:38 by dgaillet #+# #+# */
|
|
/* Updated: 2026/01/09 14:55:16 by dgaillet ### ########lyon.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
|
|
void secure_write(int fd, char *str, int len)
|
|
{
|
|
if (len < 0)
|
|
return ;
|
|
if (!str || write(fd, str, len) < 0)
|
|
exit (EXIT_FAILURE);
|
|
}
|