[PATCH] lib: fwts_acpi_object_eval.: fix build fail for ppc64el on mantic
Ivan Hu
ivan.hu at canonical.com
Fri Aug 25 07:27:00 UTC 2023
BugLink: https://bugs.launchpad.net/fwts/+bug/2033015
Got format-overflow, "error:‘%s’ directive argument is null" for ppc64el on mantic as below,
fwts_acpi_object_eval.c:790:33: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
790 | "%s package element %" PRIu32 " was not the expected "
| ^~~~~~~~~~~~~~~~~~~~~~
fwts_acpi_object_eval.c:790:34: note: format string is defined here
790 | "%s package element %" PRIu32 " was not the expected "
| ^~
fwts_acpi_object_eval.c: In function ‘fwts_method_package_elements_type__’:
fwts_acpi_object_eval.c:828:33: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
828 | "%s package element %" PRIu32 " (%s) was not the expected "
| ^~~~~~~~~~~~~~~~~~~~~~
fwts_acpi_object_eval.c:828:34: note: format string is defined here
828 | "%s package element %" PRIu32 " (%s) was not the expected "
| ^~
Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
src/lib/src/fwts_acpi_object_eval.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/src/fwts_acpi_object_eval.c b/src/lib/src/fwts_acpi_object_eval.c
index ece8fd98..24896bd6 100644
--- a/src/lib/src/fwts_acpi_object_eval.c
+++ b/src/lib/src/fwts_acpi_object_eval.c
@@ -789,7 +789,7 @@ int fwts_method_package_elements_all_type(
fwts_failed(fw, LOG_LEVEL_CRITICAL, tmp,
"%s package element %" PRIu32 " was not the expected "
"type '%s', was instead type '%s'.",
- name, i,
+ name ? name : "unknown", i,
fwts_method_type_name(type),
fwts_method_type_name(obj->Package.Elements[i].Type));
failed = true;
@@ -827,7 +827,7 @@ int fwts_method_package_elements_type__(
fwts_failed(fw, LOG_LEVEL_CRITICAL, tmp,
"%s package element %" PRIu32 " (%s) was not the expected "
"type '%s', was instead type '%s'.",
- name, i, info[i].name,
+ name ? name : "unknown", i, info[i].name,
fwts_method_type_name(info[i].type),
fwts_method_type_name(obj->Package.Elements[i].Type));
failed = true;
--
2.34.1
More information about the fwts-devel
mailing list