[PATCH] shlwapi: Fixed bad pointer arithmentic by removing sizeof() (Coverity)

Marcus Meissner meissner at suse.de
Mon Oct 17 22:50:26 CDT 2011


The sizeof() is not useful, as we already operate in *ptr sized
chunks.

Ciao, Marcus
---
 dlls/shlwapi/url.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c
index bcd413c..d43bea5 100644
--- a/dlls/shlwapi/url.c
+++ b/dlls/shlwapi/url.c
@@ -744,7 +744,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
 
             if (base.nScheme == URL_SCHEME_HTTP || base.nScheme == URL_SCHEME_HTTPS)
                 manual_search = TRUE;
-            else if (work - base.pszSuffix > len_htmW * sizeof(WCHAR)) {
+            else if (work - base.pszSuffix > len_htmW) {
                 work -= len_htmW;
                 if (strncmpiW(work, htmW, len_htmW) == 0)
                     manual_search = TRUE;
@@ -752,7 +752,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
             }
 
             if (!manual_search &&
-                    work - base.pszSuffix > len_htmlW * sizeof(WCHAR)) {
+                    work - base.pszSuffix > len_htmlW) {
                 work -= len_htmlW;
                 if (strncmpiW(work, htmlW, len_htmlW) == 0)
                     manual_search = TRUE;
-- 
1.7.1




More information about the wine-patches mailing list