diff options
Diffstat (limited to 'firmware/bidi.c')
-rw-r--r-- | firmware/bidi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/bidi.c b/firmware/bidi.c index d2458e8963..a6f6b8c5d9 100644 --- a/firmware/bidi.c +++ b/firmware/bidi.c | |||
@@ -138,15 +138,15 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation) | |||
138 | //long max_chars=0; | 138 | //long max_chars=0; |
139 | //int begin, end, char_count, orig_begin; | 139 | //int begin, end, char_count, orig_begin; |
140 | 140 | ||
141 | if (!str || !*str) | ||
142 | return &(unsigned short){0}; | ||
143 | |||
144 | //tmp = str; | 141 | //tmp = str; |
145 | target = tmp = utf16_buf; | 142 | target = tmp = utf16_buf; |
146 | while (*str) | 143 | while (*str) |
147 | str = utf8decode(str, target++); | 144 | str = utf8decode(str, target++); |
148 | *target = 0; | 145 | *target = 0; |
149 | 146 | ||
147 | if (target == utf16_buf) /* empty string */ | ||
148 | return target; | ||
149 | |||
150 | /* properly join any arabic chars */ | 150 | /* properly join any arabic chars */ |
151 | arabjoin(utf16_buf, length); | 151 | arabjoin(utf16_buf, length); |
152 | 152 | ||