aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/tcs
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-10-12 02:43:52 +0000
committerrsc <devnull@localhost>2006-10-12 02:43:52 +0000
commit2b03bf696ca055900ba587d010e731964f56ee3a (patch)
treebac7196fb57144e81e128b23302b7a8c98b66af7 /src/cmd/tcs
parenta727811a2c15ab09685d897dcc098d92052bb396 (diff)
downloadplan9port-2b03bf696ca055900ba587d010e731964f56ee3a.tar.gz
plan9port-2b03bf696ca055900ba587d010e731964f56ee3a.tar.bz2
plan9port-2b03bf696ca055900ba587d010e731964f56ee3a.zip
avoid hang with htmlroff (Michael Teichgräber)
Diffstat (limited to 'src/cmd/tcs')
-rw-r--r--src/cmd/tcs/utf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/tcs/utf.c b/src/cmd/tcs/utf.c
index f87a310b..4045332d 100644
--- a/src/cmd/tcs/utf.c
+++ b/src/cmd/tcs/utf.c
@@ -45,7 +45,7 @@ utf_in(int fd, long *notused, struct convert *out)
tot = 0;
while((n = read(fd, buf+tot, N-tot)) >= 0){
tot += n;
- for(i=j=0; i<tot-UTFmax || (n==0 && i<tot); ){
+ for(i=j=0; i<=tot-UTFmax || (i<tot && (n==0 || fullrune(buf+i, tot-i))); ){
c = our_mbtowc(&l, buf+i, tot-i);
if(c == -1){
if(squawk)