diff --git a/fs/tty.c b/fs/tty.c index 9e92686dac..d0d410a69f 100644 --- a/fs/tty.c +++ b/fs/tty.c @@ -364,7 +364,7 @@ ssize_t tty_input(struct tty *tty, const char *input, size_t size, bool blocking unlock(&tty->lock); if (fg_group != 0) { - for (int sig = 1; sig <= NUM_SIGS; sig++) { + for (int sig = 1; sig < NUM_SIGS; sig++) { if (sigset_has(queue, sig)) send_group_signal(fg_group, sig, SIGINFO_NIL); } diff --git a/kernel/signal.h b/kernel/signal.h index 5d617926e8..00fb737056 100644 --- a/kernel/signal.h +++ b/kernel/signal.h @@ -145,7 +145,7 @@ dword_t sys_rt_sigprocmask(dword_t how, addr_t set, addr_t oldset, dword_t size) int_t sys_rt_sigpending(addr_t set_addr); static inline sigset_t_ sig_mask(int sig) { - assert(sig >= 1 && sig <= NUM_SIGS); + assert(sig >= 1 && sig < NUM_SIGS); return 1l << (sig - 1); }