Fix tput when compiled with clang-15 -O2
authortb <tb@openbsd.org>
Fri, 3 Feb 2023 15:55:59 +0000 (15:55 +0000)
committertb <tb@openbsd.org>
Fri, 3 Feb 2023 15:55:59 +0000 (15:55 +0000)
commita114beb5551a982dd825247e1e02a901c05c725e
tree3938663490ac1fbff9564752df1d89796412865f
parentc80f2788a361251ef68a0526484758e9374ff1ab
Fix tput when compiled with clang-15 -O2

For some reason clang-15 doesn't like passing the uninitialized array of
pointers nargv[] to the vararg function tparm(). With -O2 it optimizes the
for loop preceding the tparm() call strangely, with the result that the
argv[i] == NULL error is hit in most real-world usage. This broke naddy's
fancy shell prompt among other things. Initialize nargv[] to appease the
insatiable undefined behavior exploiter.

ok jca millert
usr.bin/tput/tput.c