ddb: fix validation of cpu id in 'set db_cpu=x'
MFC after: 1 week
This commit is contained in:
parent
d1755e2845
commit
6e1c5d187c
@ -85,8 +85,8 @@ db_var_db_cpu(struct db_variable *vp, db_expr_t *valuep, int op)
|
||||
return (1);
|
||||
|
||||
case DB_VAR_SET:
|
||||
if (*(int *)valuep < -1 && *(int *)valuep > mp_maxid) {
|
||||
db_printf("Invalid value: %d", *(int*)valuep);
|
||||
if (*(int *)valuep < -1 || *(int *)valuep > mp_maxid) {
|
||||
db_printf("Invalid value: %d\n", *(int*)valuep);
|
||||
return (0);
|
||||
}
|
||||
db_cpu = *(int *)valuep;
|
||||
|
Loading…
Reference in New Issue
Block a user