summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2022-01-25 02:15:27 +0100
committerDmitry V. Levin <ldv@strace.io>2022-01-25 01:26:07 +0000
commit2f887e946ee37ae5b2719d1f88f86812bd085dac (patch)
tree61d81052e2a81c9dffa40d90f322bb8a272c9413
parentfca2e38caa4eef669f746f06512239dc0bd42796 (diff)
downloadstrace-2f887e946ee37ae5b2719d1f88f86812bd085dac.tar.gz
s390: fix infmname printing check
As it is a EBCDIC string, it is supposed to be checked with IS_ARRAY_ZERO, similarly to other EBCDIC strings. Also, it induces a warning with GCC 12: s390.c: In function 'print_sthyi_machine': s390.c:565:30: error: the comparison will always evaluate as 'true' for the address of 'infmname' will never be NULL [-Werror=address] 565 | if (name_val || hdr->infmname) { | ^~ s390.c:119:18: note: 'infmname' declared here 119 | char infmname[8]; /**< EBCDIC Machine Name */ | ^~~~~~~~ * src/s390.c (print_sthyi_machine): Use IS_ARRAY_ZERO for hdr->infmname non-emptiness check. Fixes: v4.21~73 "Introduce s390_sthyi system call decoder" Reported-by: Dmitry V. Levin <ldv@strace.io>
-rw-r--r--src/s390.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/s390.c b/src/s390.c
index d2cb8a32a..a931af124 100644
--- a/src/s390.c
+++ b/src/s390.c
@@ -562,7 +562,7 @@ print_sthyi_machine(struct tcb *tcp, struct sthyi_machine *hdr, uint16_t size,
}
if (!abbrev(tcp)) {
- if (name_val || hdr->infmname) {
+ if (name_val || !IS_ARRAY_ZERO(hdr->infmname)) {
tprint_struct_next();
PRINT_FIELD_EBCDIC(*hdr, infmname);
}