Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154413906
D38608.id117296.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
614 B
Referenced Files
None
Subscribers
None
D38608.id117296.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D38608: wc: Make the read buffer static.
Attached
Detach File
Event Timeline
Log In to Comment