From 0a9776fe9fc4abb18a31b7698f58a7b0fd14a51a Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 18 Sep 2023 23:33:21 +0000 Subject: [PATCH] Fix a bad cast to char * that causes incorrect results on big endian. Now that awk stores chars as int we need to cast the Node * to int *. --- usr.bin/awk/b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c index 60b38d43198..abe6750443c 100644 --- a/usr.bin/awk/b.c +++ b/usr.bin/awk/b.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b.c,v 1.39 2023/09/18 19:32:19 millert Exp $ */ +/* $OpenBSD: b.c,v 1.40 2023/09/18 23:33:21 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -533,7 +533,7 @@ int first(Node *p) /* collects initially active leaves of p into setvec */ setvec[lp] = 1; setcnt++; } - if (type(p) == CCL && (*(char *) right(p)) == '\0') + if (type(p) == CCL && (*(int *) right(p)) == '\0') return(0); /* empty CCL */ return(1); case PLUS: -- 2.20.1