Suppress this warning:
tlv_eeprom.c:490:17: warning: ‘__builtin_strncpy’ specified bound 256 equals destination size [-Wstringop-truncation]
490 | strncpy(data, strval, MAX_TLV_VALUE_LEN);
| ^
Data is a fixed-length buffer, and no terminating null character is required,
thus this warning is a false positive.
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
case TLV_CODE_VENDOR_NAME:
case TLV_CODE_DIAG_VERSION:
case TLV_CODE_SERVICE_TAG:
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(data, strval, MAX_TLV_VALUE_LEN);
+#pragma GCC diagnostic pop
new_tlv_len = min_t(size_t, MAX_TLV_VALUE_LEN, strlen(strval));
break;
case TLV_CODE_DEVICE_VERSION: