[PATCH] winspool.drv: Removed a superflous NULL check (Coverity)

Marcus Meissner marcus at jet.franken.de
Wed Jun 15 10:01:07 CDT 2011


Hi,

The first if () check is superflous, as we dereferenced it
in the CreateFile() a bit up. The check in ok() is fine, as
buf is overwritten by the call.
CID2023

Ciao, Marcus
---
 dlls/winspool.drv/tests/info.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c
index 2ef049f..9fb9070 100644
--- a/dlls/winspool.drv/tests/info.c
+++ b/dlls/winspool.drv/tests/info.c
@@ -2609,14 +2609,11 @@ static void test_GetPrinterDriver(void)
             ok(filled >= calculated,"calculated %d != filled %d\n", calculated, filled);
 
             /* Obscure test - demonstrate that Windows zero fills the buffer, even on failure */
-            if (di_2->pDataFile)
-            {
-                ret = GetPrinterDriver(hprn, NULL, level, buf, needed - 2, &filled);
-                ok(!ret, "level %d: GetPrinterDriver succeeded with less buffer than it should\n", level);
-                ok(di_2->pDataFile == NULL ||
-                   broken(di_2->pDataFile != NULL), /* Win9x/WinMe */
-                   "Even on failure, GetPrinterDriver clears the buffer to zeros\n");
-            }
+            ret = GetPrinterDriver(hprn, NULL, level, buf, needed - 2, &filled);
+            ok(!ret, "level %d: GetPrinterDriver succeeded with less buffer than it should\n", level);
+            ok(di_2->pDataFile == NULL ||
+               broken(di_2->pDataFile != NULL), /* Win9x/WinMe */
+               "Even on failure, GetPrinterDriver clears the buffer to zeros\n");
         }
 
         HeapFree(GetProcessHeap(), 0, buf);
-- 
1.7.3.4




More information about the wine-patches mailing list