diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/bidi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/bidi.c b/firmware/bidi.c index 2f4e137956..c19412693e 100644 --- a/firmware/bidi.c +++ b/firmware/bidi.c | |||
@@ -144,6 +144,7 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation) | |||
144 | unsigned short *heb_str; /* *broken_str */ | 144 | unsigned short *heb_str; /* *broken_str */ |
145 | int block_start, block_end, block_type, block_length, i; | 145 | int block_start, block_end, block_type, block_length, i; |
146 | int length = utf8length(str); | 146 | int length = utf8length(str); |
147 | length=length>=SCROLL_LINE_SIZE?SCROLL_LINE_SIZE-1:length; | ||
147 | #endif | 148 | #endif |
148 | /* | 149 | /* |
149 | long max_chars=0; | 150 | long max_chars=0; |
@@ -152,7 +153,7 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation) | |||
152 | tmp = str; | 153 | tmp = str; |
153 | */ | 154 | */ |
154 | target = tmp = utf16_buf; | 155 | target = tmp = utf16_buf; |
155 | while (*str) | 156 | while (*str && target < &utf16_buf[SCROLL_LINE_SIZE-1]) |
156 | str = utf8decode(str, target++); | 157 | str = utf8decode(str, target++); |
157 | *target = 0; | 158 | *target = 0; |
158 | 159 | ||