]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Bug fix from Robert de Bath: since lpDx_maybe is always supposed to
authorSimon Tatham <anakin@pobox.com>
Sun, 13 May 2012 15:59:22 +0000 (15:59 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 13 May 2012 15:59:22 +0000 (15:59 +0000)
equal either lpDx or NULL, we mustn't forget to update it when we
realloc lpDx.

[originally from svn r9526]

windows/window.c

index 4425e191fcdf2f9b50d4035687f021b0b3c8024a..df69db14b0d79e5c511c5cb0ef8ee25fdb2e807d 100644 (file)
@@ -3515,12 +3515,13 @@ void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
                 len += 2;
         }
 
-        if (len > lpDx_len) {
-            if (len > lpDx_len) {
-                lpDx_len = len * 9 / 8 + 16;
-                lpDx = sresize(lpDx, lpDx_len, int);
-            }
-        }
+       if (len > lpDx_len) {
+           lpDx_len = len * 9 / 8 + 16;
+           lpDx = sresize(lpDx, lpDx_len, int);
+
+           if (lpDx_maybe) lpDx_maybe = lpDx;
+       }
+
         {
             int i;
             /* only last char has dx width in SURROGATE PAIR and