Fix off-by-one error in signal number check.

This commit is contained in:
Christopher Kohlhoff 2014-06-28 20:53:58 +10:00
parent db136dfb17
commit c29914eb54

View File

@ -242,7 +242,7 @@ asio::error_code signal_set_service::add(
int signal_number, asio::error_code& ec)
{
// Check that the signal number is valid.
if (signal_number < 0 || signal_number > max_signal_number)
if (signal_number < 0 || signal_number >= max_signal_number)
{
ec = asio::error::invalid_argument;
return ec;
@ -316,7 +316,7 @@ asio::error_code signal_set_service::remove(
int signal_number, asio::error_code& ec)
{
// Check that the signal number is valid.
if (signal_number < 0 || signal_number > max_signal_number)
if (signal_number < 0 || signal_number >= max_signal_number)
{
ec = asio::error::invalid_argument;
return ec;