Fixed LZCopy return value check.

This commit is contained in:
Alexandre Julliard 2002-12-12 23:01:35 +00:00
parent 17c8b8e271
commit 12fbe313f2

View File

@ -26,7 +26,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
OFSTRUCT SourceOpenStruct1, SourceOpenStruct2; OFSTRUCT SourceOpenStruct1, SourceOpenStruct2;
DWORD dwreturn; LONG ret;
HFILE hSourceFile, hDestFile; HFILE hSourceFile, hDestFile;
if (argc < 2) if (argc < 2)
@ -43,10 +43,9 @@ int main(int argc, char *argv[])
GetExpandedName(argv[1], OriginalName); GetExpandedName(argv[1], OriginalName);
hDestFile = LZOpenFile(OriginalName, &SourceOpenStruct2, OF_CREATE | OF_WRITE); hDestFile = LZOpenFile(OriginalName, &SourceOpenStruct2, OF_CREATE | OF_WRITE);
} }
dwreturn = LZCopy(hSourceFile, hDestFile); ret = LZCopy(hSourceFile, hDestFile);
if (dwreturn != 0)
fprintf(stderr,"LZCopy failed: return is %ld\n",dwreturn);
LZClose(hSourceFile); LZClose(hSourceFile);
LZClose(hDestFile); LZClose(hDestFile);
return dwreturn; if (ret <= 0) fprintf(stderr,"LZCopy failed: return is %ld\n",ret);
return (ret <= 0);
} }