# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1038741494 0 # Node ID c2b5d0019ec3cca459844f00073f47cace493bcd # Parent 0fc45e386376925811b5efc727ef6156f92715c8 Updated dw_window_get_text() on Windows. diff -r 0fc45e386376 -r c2b5d0019ec3 win/dw.c --- a/win/dw.c Sun Dec 01 11:11:41 2002 +0000 +++ b/win/dw.c Sun Dec 01 11:18:14 2002 +0000 @@ -4305,12 +4305,12 @@ */ char *dw_window_get_text(HWND handle) { - char tempbuf[4096] = ""; - - GetWindowText(handle, tempbuf, 4095); - tempbuf[4095] = 0; - - return strdup(tempbuf); + int len = GetWindowTextLength(handle); + char *tempbuf = calloc(1, len + 2); + + GetWindowText(handle, tempbuf, len + 1); + + return tempbuf; } /*