frup: suppress stringop-truncation warning
The code involved here doesn't entirely make sense because it is
performing a sequence of hex to ascii conversions, but then
overwriting the beginning with a "0x", which seems to lose the
first 2 bytes.
Until someone has a chance to unravel this code and turn it into
a more modern implementation, suppress the GCC warning about string
truncation (since the string truncation is done by design).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I0e5001396a037cacbe7f8c534eddb8381385ebed
diff --git a/frup.cpp b/frup.cpp
index c30ea24..8f66a3b 100644
--- a/frup.cpp
+++ b/frup.cpp
@@ -626,8 +626,11 @@
/* 2 bytes for data and 1 for terminating '\0' */
snprintf(bin_byte, 3, "%02x", vpd_key_val[val]);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
/* Its a running string so strip off the '\0' */
strncat(bin_copy, bin_byte, 2);
+#pragma GCC diagnostic pop
}
/* We need the data represented as 0x...... */