mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
possible bug
This commit is contained in:
parent
a80d3bf20a
commit
33ed650231
1 changed files with 4 additions and 1 deletions
|
@ -69,9 +69,12 @@ ceGetDlgItemText( HWND hDlg, XP_U16 id, XP_UCHAR* buf, XP_U16* bLen )
|
|||
|
||||
gotLen = (XP_U16)SendDlgItemMessage( hDlg, id, WM_GETTEXT, len, (long)wbuf );
|
||||
if ( gotLen > 0 ) {
|
||||
XP_ASSERT( gotLen < len );
|
||||
if ( gotLen >= len ) {
|
||||
gotLen = len - 1;
|
||||
}
|
||||
gotLen = WideCharToMultiByte( CP_ACP, 0, wbuf, gotLen,
|
||||
buf, len, NULL, NULL );
|
||||
XP_ASSERT( gotLen < len );
|
||||
*bLen = gotLen;
|
||||
buf[gotLen] = '\0';
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue