Merge pull request #16859 from su-houzhen/fix_build_error

Fix build err
This commit is contained in:
alexey-milovidov 2020-11-12 13:45:38 +03:00 committed by GitHub
commit 2a1911d08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1293,9 +1293,11 @@ int main(int argc, const char *argv[])
return 1;
}
if (vm.count("input"))
freopen(vm["input"].as<std::string>().c_str(), "r", stdin);
if (!freopen(vm["input"].as<std::string>().c_str(), "r", stdin))
std::cout << "Error while input." << std::endl;
if (vm.count("output"))
freopen(vm["output"].as<std::string>().c_str(), "w", stdout);
if (!freopen(vm["output"].as<std::string>().c_str(), "w", stdout))
std::cout << "Error while output." << std::endl;
if (vm.empty())
std::cout << "Copy your queries (with semicolons) here, press Enter and Ctrl+D." << std::endl;
}