diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/tcs/utf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/tcs/utf.c b/src/cmd/tcs/utf.c index d3fa9398..bc7deb6e 100644 --- a/src/cmd/tcs/utf.c +++ b/src/cmd/tcs/utf.c @@ -39,15 +39,16 @@ utf_in(int fd, long *notused, struct convert *out) tot += n; for(i=j=0; i<tot; ){ c = our_mbtowc(&l, buf+i, tot-i); - if(c == -1) + if(c == -2) break; - if(c == -2){ + if(c == -1){ if(squawk) EPR "%s: bad UTF sequence near byte %ld in input\n", argv0, ninput+i); if(clean) continue; nerrors++; l = Runeerror; + c = 1; } runes[j++] = l; i += c; |