Commit f65e415d authored by C. Scott Ananian's avatar C. Scott Ananian Committed by Alexandre Julliard

UPDOWN_GetBuddyInt should not fail when the control is empty.

parent 523d94ae
......@@ -77,7 +77,7 @@ static void test_updown_control (void)
hWndUpDown = create_updown_control (hWndEdit);
/* before we set a value, it should be '0' */
num = SendMessage(hWndUpDown, UDM_GETPOS, 0, 0L);
todo_wine { ok(num == 0, "Expected 0 got %d\n", num); }
ok(num == 0, "Expected 0 got %d\n", num);
/* set a value, check it. */
SendMessage(hWndUpDown, UDM_SETPOS, 0L, MAKELONG( 1, 0));
num = SendMessage(hWndUpDown, UDM_GETPOS, 0, 0L);
......
......@@ -273,7 +273,10 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment