=?UTF-8?Q?Lauri=20Kentt=C3=A4=20?=: cmd: Compare handles to INVALID_HANDLE_VALUE, not NULL.
Alexandre Julliard
julliard at winehq.org
Tue Dec 6 16:27:45 CST 2016
Module: wine
Branch: master
Commit: 048a80ffe48a26b21f5d5a4333683a3beb6baa20
URL: http://source.winehq.org/git/wine.git/?a=commit;h=048a80ffe48a26b21f5d5a4333683a3beb6baa20
Author: Lauri Kenttä <lauri.kentta at gmail.com>
Date: Mon Dec 5 19:07:07 2016 +0200
cmd: Compare handles to INVALID_HANDLE_VALUE, not NULL.
Signed-off-by: Lauri Kenttä <lauri.kentta at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/cmd/builtins.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index a29a502..f82f15a 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -444,7 +444,7 @@ static BOOL WCMD_AppendEOF(WCHAR *filename)
h = CreateFileW(filename, GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (h == NULL) {
+ if (h == INVALID_HANDLE_VALUE) {
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(filename), GetLastError());
return FALSE;
} else {
@@ -478,7 +478,7 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app
in = CreateFileW(srcname, GENERIC_READ, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (in == NULL) {
+ if (in == INVALID_HANDLE_VALUE) {
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(srcname), GetLastError());
return FALSE;
}
@@ -486,7 +486,7 @@ static BOOL WCMD_ManualCopy(WCHAR *srcname, WCHAR *dstname, BOOL ascii, BOOL app
/* Open the output file, overwriting if not appending */
out = CreateFileW(dstname, GENERIC_WRITE, 0, NULL,
append?OPEN_EXISTING:CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- if (out == NULL) {
+ if (out == INVALID_HANDLE_VALUE) {
WINE_ERR("Failed to open %s (%d)\n", wine_dbgstr_w(dstname), GetLastError());
CloseHandle(in);
return FALSE;
More information about the wine-cvs
mailing list