Don't compare file handles to NULL

Francois Gouget fgouget at free.fr
Wed Mar 7 14:26:56 CST 2007


Jacek just sent a patch fixing the following bug:

     file = CreateFileW(fileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY,NULL);
-    if(file) {
+    if(file != INVALID_HANDLE_VALUE) {

This looks like something that could be turned into a nice Smatch test.

Hint, hint...

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
In theory, theory and practice are the same, but in practice they're different.



More information about the wine-devel mailing list