change get_binary to unsigned char

This commit is contained in:
2023-12-15 13:08:22 -08:00
parent d50611a198
commit 56f3a9b9bf
3 changed files with 5 additions and 5 deletions

View File

@ -26,14 +26,14 @@ static FILE* open_file(const char *path, size_t *fsz) {
return fp;
}
char *get_binary(const char *path, size_t *fsz) {
unsigned char *get_binary(const char *path, size_t *fsz) {
FILE *fp = open_file(path, fsz);
if (fp == NULL) {
return NULL;
}
char *buf = NULL;
buf = malloc(*fsz);
unsigned char *buf = NULL;
buf = (unsigned char*)malloc(sizeof(unsigned char) * (*fsz));
if (buf == NULL) {
fprintf(stderr, "Failed to malloc buf. Returning NULL\n");
fclose(fp);