Fix assignment vs comparison typo

At the same time, ensure a newline is written after the error message.
This commit is contained in:
Chris Spiegel
2025-11-05 06:12:41 -08:00
parent b8e3ca6a2c
commit fb162084f5

View File

@@ -1278,9 +1278,9 @@ static int cli(int argc, char** argv)
return 0;
}
BOOL err = WriteFile(file, dump.str().c_str(), dump.str().size(), NULL, NULL);
if (err = FALSE) {
fprintf(stderr, "Error writing file");
BOOL ok = WriteFile(file, dump.str().c_str(), dump.str().size(), NULL, NULL);
if (ok == FALSE) {
fprintf(stderr, "Error writing file\n");
return 1;
}
CloseHandle(file);