[coverity] Fix GetThemeSysInt

Mike Hearn mike at plan99.net
Fri Apr 7 09:33:56 CDT 2006


Mike Hearn <mike at plan99.net>
TMT_FIRSTINT and TMT_LASTINT are the same value here,
so the error path would always be taken. Fix to check
only that the values are outside the possible range.

diff --git a/dlls/uxtheme/metric.c b/dlls/uxtheme/metric.c
index e8936dd..bfbec29 100644
--- a/dlls/uxtheme/metric.c
+++ b/dlls/uxtheme/metric.c
@@ -151,8 +151,8 @@ HRESULT WINAPI GetThemeSysInt(HTHEME hTh
     TRACE("(%p, %d)\n", hTheme, iIntID);
     if(!hTheme)
         return E_HANDLE;
-    if(iIntID <= TMT_FIRSTINT || iIntID >= TMT_LASTINT) {
-        TRACE("Unknown IntID: %d\n", iIntID);
+    if(iIntID < TMT_FIRSTINT || iIntID > TMT_LASTINT) {
+        WARN("Unknown IntID: %d\n", iIntID);
         return STG_E_INVALIDPARAMETER;
     }
     if((tp = MSSTYLES_FindMetric(TMT_INT, iIntID)))



More information about the wine-patches mailing list