Skip to content

Commit

Permalink
fixing truncation error
Browse files Browse the repository at this point in the history
Alternative solution to rockchip-linux#67
  • Loading branch information
martinSusz authored Dec 2, 2022
1 parent 21cebf4 commit 1e6322c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ static bool saveEntry(FILE* outFile, char* path, rk_entry_type type,
static inline uint32_t convertChipType(const char* chip) {
char buffer[5];
memset(buffer, 0, sizeof(buffer));
snprintf(buffer, sizeof(buffer), "%s", chip);
memcpy(buffer, chip, sizeof(buffer));
return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];
}

Expand Down

0 comments on commit 1e6322c

Please sign in to comment.