changeset 990:3d898b78c2ad

Fix return value of dw_mle_import() after importing empty string on OS/2. There seem to be other inconsistencies with the other platforms... however due to the way MLE's work the inconsistencies don't cause issues... so ignoring for now.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 07 May 2011 15:20:34 +0000
parents 6de00477d627
children 64c4c40c5835
files os2/dw.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Sat May 07 14:42:35 2011 +0000
+++ b/os2/dw.c	Sat May 07 15:20:34 2011 +0000
@@ -6357,7 +6357,7 @@
  */
 unsigned int API dw_mle_import(HWND handle, char *buffer, int startpoint)
 {
-   unsigned long point = startpoint;
+   long point = startpoint < 0 ? 0 : startpoint;
    PBYTE mlebuf;
 
    /* Work around 64K limit */
@@ -6375,7 +6375,7 @@
          memcpy(mlebuf, &buffer[written], amount);
          mlebuf[amount] = '\0';
 
-         WinSendMsg(handle, MLM_SETIMPORTEXPORT, MPFROMP(mlebuf), MPFROMLONG(amount+1));
+         WinSendMsg(handle, MLM_SETIMPORTEXPORT, MPFROMP(mlebuf), MPFROMLONG(amount + 1));
          WinSendMsg(handle, MLM_IMPORT, MPFROMP(&point), MPFROMLONG(amount + 1));
          dw_mle_delete(handle, point, 1);