fix locking for reference counts, enable GDI thread again
[enigma2.git] / lib / gdi / font.cpp
index f7c1bca5ed59f075bc5b2acb334555ea68e59dd1..329c4679c9db68e5e5a797681bda091853b0bf8b 100644 (file)
@@ -470,9 +470,9 @@ int eTextPara::renderString(const char *string, int rflags)
        if (string)
                uc_string.reserve(strlen(string));
        
-       const char *p = string;
+       const char *p = string ? string : "";
 
-       while(p)
+       while (*p)
        {
                unsigned int unicode=(unsigned char)*p++;
 
@@ -482,28 +482,28 @@ int eTextPara::renderString(const char *string, int rflags)
                        {
                                unicode&=0x1F;
                                unicode<<=6;
-                               if (p)
+                               if (*p)
                                        unicode|=(*p++)&0x3F;
                        } else if ((unicode & 0xF0)==0xE0) // three bytes
                        {
                                unicode&=0x0F;
                                unicode<<=6;
-                               if (p)
+                               if (*p)
                                        unicode|=(*p++)&0x3F;
                                unicode<<=6;
-                               if (p)
+                               if (*p)
                                        unicode|=(*p++)&0x3F;
                        } else if ((unicode & 0xF8)==0xF0) // four bytes
                        {
                                unicode&=0x07;
                                unicode<<=6;
-                               if (p)
+                               if (*p)
                                        unicode|=(*p++)&0x3F;
                                unicode<<=6;
-                               if (p)
+                               if (*p)
                                        unicode|=(*p++)&0x3F;
                                unicode<<=6;
-                               if (p)
+                               if (*p)
                                        unicode|=(*p++)&0x3F;
                        }
                }