diff options
| author | Charles.Forsyth <devnull@localhost> | 2008-01-22 21:54:45 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2008-01-22 21:54:45 +0000 |
| commit | 9b29ac7ea714507a9c0690620c02c8ca5ab25f90 (patch) | |
| tree | 1eeb3e33858dfc27844b520036f2119869f9088b /appl/lib/convcs/utf8_btos.b | |
| parent | 60951762adc08955ddba7ff59f6043e7a542a0f2 (diff) | |
20080122-2200
Diffstat (limited to 'appl/lib/convcs/utf8_btos.b')
| -rw-r--r-- | appl/lib/convcs/utf8_btos.b | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/appl/lib/convcs/utf8_btos.b b/appl/lib/convcs/utf8_btos.b index 7ed10ddd..307ef863 100644 --- a/appl/lib/convcs/utf8_btos.b +++ b/appl/lib/convcs/utf8_btos.b @@ -23,12 +23,11 @@ btos(nil : Convcs->State, b : array of byte, n : int) : (Convcs->State, string, str = string b[:nbytes]; } else { for (; nbytes < len b && len str < n;) { - (ch, l, s) := sys->byte2char(b, nbytes); - if (l > 0) { - str[len str] = ch; - nbytes += l; - } else + (ch, l, nil) := sys->byte2char(b, nbytes); + if (l <= 0) break; + str[len str] = ch; + nbytes += l; } } return (nil, str, nbytes); |
