Usermode/axwin3 - RichText cursor (hacked)
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / wm_render_text.c
index d189e5e..8258531 100644 (file)
@@ -8,7 +8,8 @@
 #include <common.h>
 #include <wm_internals.h>
 #include <stdlib.h>
-#include <utf8.h>
+#include <unicode.h>
+#include <limits.h>    // INT_MAX
 
 // === TYPES ===
 typedef struct sGlyph  tGlyph;
@@ -171,7 +172,7 @@ tGlyph *_GetGlyph(tFont *Font, uint32_t Codepoint)
                                 prev = next, next = next->Next
                                 );
                        
-                       if( next->Codepoint == Codepoint )
+                       if( next && next->Codepoint == Codepoint )
                                return next;
                        
                }
@@ -185,7 +186,7 @@ tGlyph *_GetGlyph(tFont *Font, uint32_t Codepoint)
                                 prev && prev->Codepoint > Codepoint;
                                 next = prev, prev = prev->Prev
                                 );
-                       if( prev->Codepoint == Codepoint )
+                       if( prev && prev->Codepoint == Codepoint )
                                return prev;
                }
        }

UCC git Repository :: git.ucc.asn.au