Fix idl_nextid not to skip an ID if ID not in list.
Both of these should not occur if used correctly, but cheap insurance
against incorrect usage is welcomed.
}
if ( ID_BLOCK_ALLIDS( idl ) ) {
- return( ID_BLOCK_NIDS(idl) == 1 ? NOID : 1 );
+ return( ID_BLOCK_NIDS(idl) > 1 ? 1 : NOID );
}
return( ID_BLOCK_ID(idl, 0) );
return( ++id < ID_BLOCK_NIDS(idl) ? id : NOID );
}
- for ( i = 0; i < ID_BLOCK_NIDS(idl) && ID_BLOCK_ID(idl, i) < id; i++ ) {
+ for ( i = 0; i < ID_BLOCK_NIDS(idl) && ID_BLOCK_ID(idl, i) <= id; i++ ) {
; /* NULL */
}
- i++;
if ( i >= ID_BLOCK_NIDS(idl) ) {
return( NOID );