Re: advapi32: sign-compare fixes
Joris Huizer wrote:
- int len = WideCharToMultiByte(CP_ACP, 0, lpNameW, -1, lpName, + unsigned int len = WideCharToMultiByte(CP_ACP, 0, lpNameW, -1, lpName, This isn't right. WideCharToMultiByte returns INT, which is signed.
@@ -1995,11 +1995,11 @@ LookupAccountSidW(
if (dm) { BOOL status = TRUE; - if (*accountSize > lstrlenW(ac)) { + if (*accountSize > (unsigned)lstrlenW(ac)) { if (account) lstrcpyW(account, ac); } - if (*domainSize > lstrlenW(dm)) { + if (*domainSize > (unsigned)lstrlenW(dm)) { if (domain) lstrcpyW(domain, dm); } This isn't correct either. lstrlenW() also returns INT and you can't just cast it to (unsigned). Unsigned what? int/long/dword?
Vitaliy.
Vitaliy Margolen <wine-devel(a)kievinfo.com> wrote: Joris Huizer wrote:
- int len = WideCharToMultiByte(CP_ACP, 0, lpNameW, -1, lpName, + unsigned int len = WideCharToMultiByte(CP_ACP, 0, lpNameW, -1, lpName, This isn't right. WideCharToMultiByte returns INT, which is signed.
@@ -1995,11 +1995,11 @@ LookupAccountSidW(
if (dm) { BOOL status = TRUE; - if (*accountSize > lstrlenW(ac)) { + if (*accountSize > (unsigned)lstrlenW(ac)) { if (account) lstrcpyW(account, ac); } - if (*domainSize > lstrlenW(dm)) { + if (*domainSize > (unsigned)lstrlenW(dm)) { if (domain) lstrcpyW(domain, dm); } This isn't correct either. lstrlenW() also returns INT and you can't just cast it to (unsigned). Unsigned what? int/long/dword?
Vitaliy. Sorry I'll fix it; Will try and check in future Joris --------------------------------- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit.
On Wed, 7 Feb 2007, Vitaliy Margolen wrote: [...]
This isn't correct either. lstrlenW() also returns INT and you can't just cast it to (unsigned). Unsigned what? int/long/dword?
In C, 'unsigned' is synonymous with 'unsigned int'. So it's unambiguous. -- Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/ Dieu dit: "M-x Lumière". Et la lumière fut.
participants (3)
-
Francois Gouget -
Joris Huizer -
Vitaliy Margolen