aboutsummaryrefslogtreecommitdiff
path: root/src/base/fmt/do.c
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-20 20:12:21 -0800
committerNicholas <nbnoll@eml.cc>2021-11-20 20:12:21 -0800
commit138fb272fae79587de3469493b55e4d18eadc722 (patch)
tree447d2af80b8c2ea080253e76d33e128c9b27d3f6 /src/base/fmt/do.c
parentc9a32c1a43d2bdded07eaa45732c3a6e195a5442 (diff)
Feat: added buffered io from plan9
As we no longer have the FILE type, we need to buffer our reading and writing so that we don't have to make so many syscalls. The API is nice so that we can buffer other readers. We will update it so that it eats io·Readers/io·Writers.
Diffstat (limited to 'src/base/fmt/do.c')
-rw-r--r--src/base/fmt/do.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base/fmt/do.c b/src/base/fmt/do.c
index 71b005e..3825fc8 100644
--- a/src/base/fmt/do.c
+++ b/src/base/fmt/do.c
@@ -212,7 +212,7 @@ copy(fmt·State *io, char *m, int sz, int n)
if(utf8·onebyte(r)){
nb=1;
m++;
- }else if((me-m) >= UTFmax || utf8·canfit(m, me-m)){
+ }else if((me-m) >= UTFmax || utf8·fullrune(m, me-m)){
nb=utf8·decode(m, &r);
m+=n;
}else