提交 23815f88 编写于 作者: R Rich Felker

fix off-by-one error in checks for implementation-internal signal numbers

上级 b823ef2d
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
int sigaddset(sigset_t *set, int sig) int sigaddset(sigset_t *set, int sig)
{ {
unsigned s = sig-1; unsigned s = sig-1;
if (s >= 8*sizeof(sigset_t) || s-32U<3) { if (s >= 8*sizeof(sigset_t) || sig-32U<3) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
int sigdelset(sigset_t *set, int sig) int sigdelset(sigset_t *set, int sig)
{ {
unsigned s = sig-1; unsigned s = sig-1;
if (s >= 8*sizeof(sigset_t) || s-32U<3) { if (s >= 8*sizeof(sigset_t) || sig-32U<3) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
int sigismember(const sigset_t *set, int sig) int sigismember(const sigset_t *set, int sig)
{ {
unsigned s = sig-1; unsigned s = sig-1;
if (s >= 8*sizeof(sigset_t) || s-32U<3) { if (s >= 8*sizeof(sigset_t) || sig-32U<3) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册