Skip to content

Commit

Permalink
fix mmap bad check
Browse files Browse the repository at this point in the history
  • Loading branch information
tsiguenz committed Feb 7, 2024
1 parent e118df5 commit 5c707ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int set_file_size(char *filename, int fd, off_t *file_size) {
int set_mapped_file(int fd, off_t file_size, uint8_t **map) {
*map = mmap(NULL, file_size, PROT_READ, MAP_PRIVATE, fd, 0);
close(fd);
if (map == MAP_FAILED) {
if (*map == MAP_FAILED) {
ft_printf_fd(2, "%s: error: %s\n", prog_name, strerror(errno));
return EXIT_FAILURE;
}
Expand Down

0 comments on commit 5c707ed

Please sign in to comment.