From: millert Date: Mon, 18 Sep 2023 23:33:21 +0000 (+0000) Subject: Fix a bad cast to char * that causes incorrect results on big endian. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0a9776fe9fc4abb18a31b7698f58a7b0fd14a51a;p=openbsd 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 *. --- 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: