updown: UDM_GETPOS should return 0 when empty.

C. Scott Ananian cscott at cscott.net
Thu Mar 17 13:56:57 CST 2005


ChangeLog:
  - UPDOWN_GetBuddyInt should not fail when the control is empty.
    This corrects a testcase which wine has been failing (ie UDM_GETPOS
    returning MAKELONG(0,1) instead of 0, as it ought).

This fixes a problem with 'sd', which is in the Wine applications 
database. [Sequence numbers starting with 65536 on startup.]
  --scott

PBSUCCESS CABOUNCE LICOZY mustard terrorist Saddam Hussein Boston 
Flintlock agent Castro MKDELTA Ft. Meade Minister assassination politics
                          ( http://cscott.net/ )

Index: dlls/comctl32/updown.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/updown.c,v
retrieving revision 1.64
diff -u -p -r1.64 updown.c
--- dlls/comctl32/updown.c	24 Nov 2004 18:28:31 -0000	1.64
+++ dlls/comctl32/updown.c	17 Mar 2005 19:43:04 -0000
@@ -273,7 +273,10 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_I
          if(newVal < 0) return FALSE;
      } else {
          /* we have a regular window, so will get the text */
-        if (!GetWindowTextW(infoPtr->Buddy, txt, COUNT_OF(txt))) return FALSE;
+	/* note that a zero-length string is a legitimate value for 'txt',
+	 * and ought to result in a successful conversion to '0'. */
+        if (GetWindowTextW(infoPtr->Buddy, txt, COUNT_OF(txt)) < 0)
+	    return FALSE;

          sep = UPDOWN_GetThousandSep();




More information about the wine-patches mailing list