woody-woodpacker/srcs/utils.c

17 lines
439 B
C
Raw Normal View History

2024-02-14 10:37:05 +00:00
#include "../includes/woody.h"
2024-02-21 12:54:33 +00:00
void *fetch(char *file, unsigned long file_size, unsigned long offset_to_data, unsigned long supposed_data_size)
2024-02-14 10:37:05 +00:00
{
if (file_size > offset_to_data && file_size >= (offset_to_data + supposed_data_size))
return (file + offset_to_data);
return NULL;
}
int ft_put_error(char *str)
{
ft_putstr_fd("Error: ", STDERR_FILENO);
ft_putstr_fd(str, 2);
ft_putstr_fd("\n", STDERR_FILENO);
return EXIT_FAILURE;
}