下标越界判断有误(interrupt.c)

This commit is contained in:
Eziotao 2023-04-13 17:47:26 +08:00 committed by guo
parent 2638a2a90c
commit 870bf84964
1 changed files with 3 additions and 3 deletions

View File

@ -70,7 +70,7 @@ void rt_hw_interrupt_init(void)
void rt_hw_interrupt_mask(int vector)
{
int index;
if ((vector < 0) || (vector > INTERRUPTS_MAX))
if ((vector < 0) || (vector >= INTERRUPTS_MAX))
{
return;
}
@ -89,7 +89,7 @@ void rt_hw_interrupt_mask(int vector)
void rt_hw_interrupt_umask(int vector)
{
int index;
if ((vector < 0) || (vector > INTERRUPTS_MAX))
if ((vector < 0) || (vector >= INTERRUPTS_MAX))
{
return;
}
@ -114,7 +114,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
rt_isr_handler_t old_handler = RT_NULL;
int index;
if ((vector < 0) || (vector > INTERRUPTS_MAX))
if ((vector < 0) || (vector >= INTERRUPTS_MAX))
{
return old_handler;
}