make ui_draw_text a bit safer when cache_get_text returns NULL

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@285 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Jay Sorg 2002-12-23 18:40:03 +00:00
parent 19c34cdbc6
commit 17e9c6b607

16
xwin.c
View File

@ -1279,17 +1279,17 @@ ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,
else else
x += text[i + 2]; x += text[i + 2];
} }
if (i + 2 < length)
i += 3;
else
i += 2;
length -= i;
/* this will move pointer from start to first character after FE command */
text = &(text[i]);
i = 0;
for (j = 0; j < entry->size; j++) for (j = 0; j < entry->size; j++)
DO_GLYPH(((uint8 *) (entry->data)), j); DO_GLYPH(((uint8 *) (entry->data)), j);
} }
if (i + 2 < length)
i += 3;
else
i += 2;
length -= i;
/* this will move pointer from start to first character after FE command */
text = &(text[i]);
i = 0;
break; break;
default: default: