Fix bugs in port first, next commands.

Previous commits changed the port IDs to an integer rather than a
bitfield. However, the first and next commands were utilizing that
a -1 became a large positive integer when masked. This resulted in
the min port operations failing. Added a default comparison with -1
to fix the problem.
This commit is contained in:
mrg 2022-06-13 13:05:57 -07:00
parent 085131b090
commit 278194ae96
1 changed files with 2 additions and 2 deletions

View File

@ -1745,7 +1745,7 @@ CmdPort(w, cmd)
if (sl->lab_flags & PORT_DIR_MASK)
{
idx = (int)sl->lab_port;
if (idx < i) i = idx;
if (idx < i || i == -1) i = idx;
}
}
#ifdef MAGIC_WRAPPER
@ -1764,7 +1764,7 @@ CmdPort(w, cmd)
{
idx = (int)sl->lab_port;
if (idx > refidx)
if (idx < i) i = idx;
if (idx < i || i == -1) i = idx;
}
}
#ifdef MAGIC_WRAPPER