Page MenuHomeFreeBSD

D38608.id117296.diff
No OneTemporary

D38608.id117296.diff

diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c
--- a/usr.bin/wc/wc.c
+++ b/usr.bin/wc/wc.c
@@ -214,9 +214,10 @@
static int
cnt(const char *file)
{
- char buf[MAXBSIZE], *p;
+ static char buf[MAXBSIZE];
struct stat sb;
mbstate_t mbs;
+ const char *p;
uintmax_t linect, wordct, charct, llct, tmpll;
ssize_t len;
size_t clen;
@@ -259,7 +260,7 @@
* lines than to get words, since the word count requires locale
* handling.
*/
- while ((len = read(fd, buf, sizeof(buf)))) {
+ while ((len = read(fd, buf, sizeof(buf))) != 0) {
if (len < 0) {
xo_warn("%s: read", file);
(void)close(fd);

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 29, 10:01 AM (47 m, 30 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32341931
Default Alt Text
D38608.id117296.diff (614 B)

Event Timeline