* pwdgrp.h (pwdgrp_read::open): Compare fh to INVALID_HANDLE_VALUE.

This commit is contained in:
Christopher Faylor
2002-10-24 14:33:13 +00:00
parent a8ab20942e
commit 950a7601d1
2 changed files with 6 additions and 3 deletions

View File

@@ -71,7 +71,7 @@ public:
fh = CreateFile (pc, GENERIC_READ, wincap.shared (), NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, 0);
if (fh)
if (fh != INVALID_HANDLE_VALUE)
{
DWORD size = GetFileSize (fh, NULL), read_bytes;
buf = (char *) malloc (size + 1);
@@ -84,7 +84,7 @@ public:
fh = NULL;
return false;
}
buf[read_bytes] = '\0';
buf[read_bytes] = '\0';
return true;
}
return false;