| 5016d112 | 16-Feb-2023 |
Dag-Erling Smørgrav <[email protected]> |
wc: Make the read buffer static.
The read buffer in cnt() is 64 kB, which is a bit excessive for a stack variable. MAXBSIZE has grown since this code was originally written, and it might grow again
wc: Make the read buffer static.
The read buffer in cnt() is 64 kB, which is a bit excessive for a stack variable. MAXBSIZE has grown since this code was originally written, and it might grow again in the future. Since the program is single-threaded and cnt() does not recurse, we can safely make the buffer static.
While there, constify p since it is only used to read.
Sponsored by: Klara, Inc. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38608
show more ...
|