From: <mie...@us...> - 2008-01-26 21:45:10
|
Revision: 2312 http://oorexx.svn.sourceforge.net/oorexx/?rev=2312&view=rev Author: miesfeld Date: 2008-01-26 13:45:08 -0800 (Sat, 26 Jan 2008) Log Message: ----------- Fix for logic error in EditControl getText() Modified Paths: -------------- interpreter-3.x/trunk/platform/windows/oodialog/oovother.c Modified: interpreter-3.x/trunk/platform/windows/oodialog/oovother.c =================================================================== --- interpreter-3.x/trunk/platform/windows/oodialog/oovother.c 2008-01-26 21:13:53 UTC (rev 2311) +++ interpreter-3.x/trunk/platform/windows/oodialog/oovother.c 2008-01-26 21:45:08 UTC (rev 2312) @@ -1211,15 +1211,23 @@ } else { - if ( ++count > retstr->strlength ) + if ( ++count > RXAUTOBUFLEN ) { PVOID p = GlobalAlloc(GMEM_FIXED, count); - if ( ! p ) return GetLastError(); + if ( ! p ) + { + RETVAL(-(LONG)GetLastError()) + } retstr->strptr = (PCHAR)p; } count = GetWindowText(hCtrl, (LPTSTR)retstr->strptr, count); - retstr->strlength = strlen(retstr->strptr); + + retstr->strlength = count; + if ( count == 0 ) + { + retstr->strptr[0] = '\0'; + } } } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |