pldm: Migrate to pldm_bios_table_attr_value_entry_encode_integer_check()

pldm_bios_table_attr_value_entry_encode_integer() is deprecated in
libpldm as it uses assert() to sanitize its parameters. Use
pldm_bios_table_attr_value_entry_encode_integer_check() instead, which
returns a value indicating success or failure.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ic308d24a83fe3371a7ef074cb1d20092a06a1291
diff --git a/libpldmresponder/bios_table.cpp b/libpldmresponder/bios_table.cpp
index f4fcecf..3598277 100644
--- a/libpldmresponder/bios_table.cpp
+++ b/libpldmresponder/bios_table.cpp
@@ -329,8 +329,16 @@
 
     auto tableSize = table.size();
     table.resize(tableSize + entryLength);
-    pldm_bios_table_attr_value_entry_encode_integer(
+    int rc = pldm_bios_table_attr_value_entry_encode_integer_check(
         table.data() + tableSize, entryLength, attrHandle, attrType, value);
+    if (rc != PLDM_SUCCESS)
+    {
+        lg2::error(
+            "Failed to encode BIOS attribute table integer entry: {LIBPLDM_ERROR}",
+            "LIBPLDM_ERROR", rc);
+        throw std::runtime_error(
+            "Failed to encode BIOS attribute table integery entry");
+    }
     return reinterpret_cast<pldm_bios_attr_val_table_entry*>(table.data() +
                                                              tableSize);
 }