未验证 提交 d5c2008c 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #11601 from filimonov/fix_client_exit_code

Fix corner case (only) for exit code overflow
......@@ -1920,7 +1920,11 @@ public:
std::string text = e.displayText();
std::cerr << "Code: " << e.code() << ". " << text << std::endl;
std::cerr << "Table №" << i << std::endl << std::endl;
exit(e.code());
/// Avoid the case when error exit code can possibly overflow to normal (zero).
auto exit_code = e.code() % 256;
if (exit_code == 0)
exit_code = 255;
exit(exit_code);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册