From 26aaf9d283cacf589aafe71fcce0a204635c526b Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 7 Mar 2022 10:23:42 +1100 Subject: [PATCH] Simplify convertChipType and fix truncation error. The error stopping compilations is format-truncation. --- main.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 72bd94b..f381e1a 100644 --- a/main.cpp +++ b/main.cpp @@ -1488,10 +1488,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); - return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3]; + return chip[0] << 24 | chip[1] << 16 | chip[2] << 8 | chip[3]; } static inline uint32_t getChipType(const char* chip) {