17 lines
447 B
C
17 lines
447 B
C
#include "../includes/woody.h"
|
|
|
|
void *secure_access(char *file, unsigned long file_size, unsigned long offset_to_data, unsigned long supposed_data_size)
|
|
{
|
|
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;
|
|
}
|