comparison win/dw.c @ 1627:b41ecd439b47

dw_window_get_text() was truncating the text by 1 byte in Unicode mode on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 28 Mar 2012 02:47:55 +0000
parents c5aab296fba3
children 2571d6b23065
comparison
equal deleted inserted replaced
1626:fdeeba6c6d09 1627:b41ecd439b47
6781 } 6781 }
6782 6782
6783 /* Figure out the wide length, allocate a temp buffer 6783 /* Figure out the wide length, allocate a temp buffer
6784 * and fill it with the current text. 6784 * and fill it with the current text.
6785 */ 6785 */
6786 len = GetWindowTextLength(handle); 6786 len = GetWindowTextLength(handle) + 1;
6787 if((tempbuf = _alloca(len * sizeof(TCHAR)))) 6787 if((tempbuf = _alloca(len * sizeof(TCHAR))))
6788 GetWindowText(handle, tempbuf, len); 6788 GetWindowText(handle, tempbuf, len);
6789 6789
6790 /* Figure out the UTF8 length, allocate a return buffer 6790 /* Figure out the UTF8 length, allocate a return buffer
6791 * and fill it with the UTF8 text and return it. 6791 * and fill it with the UTF8 text and return it.