Write warning messages about invalid type 42 structures to stderr as we do for all other warning messages.
Also include the handle and record numbers in these warning messages to make the problem easier to analyze. Signed-off-by: Jean Delvare <jdelv...@suse.de> --- dmidecode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- dmidecode.orig/dmidecode.c 2020-03-13 16:22:59.516249509 +0100 +++ dmidecode/dmidecode.c 2020-03-13 16:25:26.952040621 +0100 @@ -3780,8 +3780,9 @@ static void dmi_parse_controller_structu total_read++; if (total_read > h->length) { - printf("%s\tWARN: Total read length %d exceeds total structure length %d\n", - prefix, total_read, h->length); + fprintf(stderr, + "Total read length %d exceeds total structure length %d (handle 0x%04hx)\n", + total_read, h->length, h->handle); return; } @@ -3801,8 +3802,9 @@ static void dmi_parse_controller_structu total_read += rec[1] + 2; if (total_read > h->length) { - printf("%s\tWARN: Total read length %d exceeds total structure length %d\n", - prefix, total_read, h->length); + fprintf(stderr, + "Total read length %d exceeds total structure length %d (handle 0x%04hx, record %d)\n", + total_read, h->length, h->handle, i + 1); return; } -- Jean Delvare SUSE L3 Support _______________________________________________ https://lists.nongnu.org/mailman/listinfo/dmidecode-devel