Ver Fonte

Fix assignment vs comparison typo

At the same time, ensure a newline is written after the error message.
Chris Spiegel há 1 mês atrás
pai
commit
fb162084f5
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      one.cpp

+ 3 - 3
one.cpp

@@ -1278,9 +1278,9 @@ static int cli(int argc, char** argv)
 				return 0;
 				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;
 				return 1;
 			}
 			}
 			CloseHandle(file);
 			CloseHandle(file);