trace: fix pointer cross the border
Fix pointer cross the border Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
parent
d868387148
commit
e3df21cd4c
@ -485,6 +485,8 @@ static int trace_cmd_switch(int index, int argc, FAR char **argv,
|
|||||||
|
|
||||||
/* Parse the setting parameters */
|
/* Parse the setting parameters */
|
||||||
|
|
||||||
|
if (index < argc)
|
||||||
|
{
|
||||||
if (argv[index][0] == '-' || argv[index][0] == '+')
|
if (argv[index][0] == '-' || argv[index][0] == '+')
|
||||||
{
|
{
|
||||||
enable = (argv[index][0] == '+');
|
enable = (argv[index][0] == '+');
|
||||||
@ -509,6 +511,7 @@ static int trace_cmd_switch(int index, int argc, FAR char **argv,
|
|||||||
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
@ -735,6 +738,8 @@ static int trace_cmd_print(int index, int argc, FAR char **argv,
|
|||||||
|
|
||||||
/* Parse the setting parameters */
|
/* Parse the setting parameters */
|
||||||
|
|
||||||
|
if (index < argc)
|
||||||
|
{
|
||||||
if (argv[index][0] == '-' || argv[index][0] == '+')
|
if (argv[index][0] == '-' || argv[index][0] == '+')
|
||||||
{
|
{
|
||||||
enable = (argv[index][0] == '+');
|
enable = (argv[index][0] == '+');
|
||||||
@ -759,6 +764,7 @@ static int trace_cmd_print(int index, int argc, FAR char **argv,
|
|||||||
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user