UPDOWN_GetBuddyInt should not fail when the control is empty.
diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c index 5084b89..9016fde 100644 --- a/dlls/comctl32/tests/updown.c +++ b/dlls/comctl32/tests/updown.c
@@ -77,7 +77,7 @@ 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);
diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 08d01f8..d2e6f60 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c
@@ -273,7 +273,10 @@ 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();