Skip to content

Commit

Permalink
fix: Unable to recognize e_machine of length 2 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
msojocs authored and TheAssassin committed May 17, 2024
1 parent 75c4f37 commit bb97414
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/appimagetool.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,9 @@ int16_t read_elf_e_machine_field(const gchar* file_path) {
file = fopen(file_path, "rb");
if (file) {
fseek(file, 0x12, SEEK_SET);
fgets((char*) (&e_machine), 0x02, file);
fread(&e_machine, sizeof(e_machine), 1, file);
fclose(file);
e_machine = GINT16_FROM_LE(e_machine);
}

return e_machine;
Expand Down

0 comments on commit bb97414

Please sign in to comment.