Skip to content

Commit

Permalink
nvram.c: fix compilier warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Fasano committed Oct 16, 2024
1 parent 4dfd0b8 commit a3eb649
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ int libinject_nvram_get_buf(const char *key, char *buf, size_t sz) {
}
else
{
PRINT_MSG("\n\n[NVRAM] %d %s\n\n", strlen(key), key);
PRINT_MSG("\n\n[NVRAM] %d %s\n\n", (int)strlen(key), key);

// success
rv = igloo_hypercall2(108, (unsigned long)path, strlen(path));
Expand Down Expand Up @@ -726,7 +726,13 @@ int libinject_parse_nvram_from_file(const char *file)

/* Allocate memory */
buffer = (char*)malloc(sizeof(char) *fileLen);
fread(buffer, 1, fileLen, f);
int rv = fread(buffer, 1, fileLen, f);
if (rv != fileLen) {
PRINT_MSG("Unable to read file: %s: %d!\n", file, rv);
free(buffer);
fclose(f);
return E_FAILURE;
}
fclose(f);

/* split the buffer including null byte */
Expand Down

0 comments on commit a3eb649

Please sign in to comment.