Bug fix from Robert de Bath: since lpDx_maybe is always supposed to
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 13 May 2012 15:59:22 +0000 (15:59 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
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.

git-svn-id: svn://svn.tartarus.org/sgt/putty@9526 cda61777-01e9-0310-a592-d414129be87e

windows/window.c

index 4425e19..df69db1 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