summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/bidi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/bidi.c b/firmware/bidi.c
index d2458e8..a6f6b8c 100644
--- a/firmware/bidi.c
+++ b/firmware/bidi.c
@@ -138,15 +138,15 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation)
//long max_chars=0;
//int begin, end, char_count, orig_begin;
- if (!str || !*str)
- return &(unsigned short){0};
-
//tmp = str;
target = tmp = utf16_buf;
while (*str)
str = utf8decode(str, target++);
*target = 0;
+ if (target == utf16_buf) /* empty string */
+ return target;
+
/* properly join any arabic chars */
arabjoin(utf16_buf, length);