--- sourceforge.net/trunk/rdesktop/xwin.c 2002/04/07 09:42:54 42 +++ sourceforge.net/trunk/rdesktop/xwin.c 2002/04/10 14:07:56 44 @@ -870,7 +870,8 @@ int bgcolour, int fgcolour, uint8 *text, uint8 length) { FONTGLYPH *glyph; - int i, offset; + short offset; + int i; SET_FOREGROUND(bgcolour); @@ -892,7 +893,19 @@ { offset = text[++i]; if (offset & 0x80) - offset = ((offset & 0x7f) << 8) | text[++i]; + { + if (offset == 0x80) + { + /* next two bytes, little-endian */ + offset = text[++i]; + offset |= text[++i] << 8; + } + else + { + offset = (offset & 0x7f) << 8; + offset |= text[++i]; + } + } if (flags & TEXT2_VERTICAL) y += offset;