Remove unneeded function

This commit is contained in:
2023-12-05 12:57:16 -04:00
parent 530ab9a135
commit 93635bc1d6
3 changed files with 6 additions and 23 deletions

View File

@@ -35,31 +35,17 @@
#include <stdbool.h>
#include "png.h"
int get_fd(char *path) {
FILE *get_file(char *path) {
FILE *fp = fopen(path, "rb");
if (fp == NULL) {
perror("fopen");
exit(EXIT_FAILURE);
}
int fd = fileno(fp);
if (fd == -1) {
perror("fileno");
exit(EXIT_FAILURE);
}
return fd;
}
FILE *get_fp(int fd) {
FILE *fp = fdopen(fd, "rb");
if (fp == NULL) {
perror("fdopen");
exit(EXIT_FAILURE);
}
return fp;
}
char *load_file(int fd) {
FILE *fp = get_fp(fd);
char *load_file(char *path) {
FILE *fp = get_file(path);
fseek(fp, 0, SEEK_END);
long size = ftell(fp);
rewind(fp);