Bug Fix: WM_GETTEXT should return NULL string if LB_GETCURSEL is LB_ERR

Dmitry Timoshkov dmitry at baikal.ru
Mon Jul 15 23:31:29 CDT 2002


"Shachar Shemesh" <wine-devel at sun.consumer.org.il> wrote:

> +    LPWSTR lpText = (LPWSTR)lParam;
> +    lpText[0] = '\0';
> 
> 
> Shouldn't it be
> 
> +    LPWSTR lpText = (LPWSTR)lParam;
> +    lpText[0] = L'\0';
> 
> ?

Due to a difference between *nix and win32 unicode character sizes
(4 vs. 2 bytes), personally I prefer to avoid such an ambiguity and
simply use plain 0 instead. But '\0' will work just fine.

IMO Wine should not use L prefix at all and explicitly convert ANSI
to unicode when it's needed or use explicit unicode character constants:
static const WCHAR fooW[] = {'f','o','o',0};
but never L"foo".

-- 
Dmitry.






More information about the wine-devel mailing list