Fix the test for SET_FOREACH termination.

Unlike the queue(3) _FOREACH macros, the iterator for a SET_FOREACH is
not NULL after the end of the set is reached.
This commit is contained in:
markj 2018-02-15 17:35:40 +00:00
parent 44981bb96d
commit e1e7fa21c2

View File

@ -498,7 +498,7 @@ compressor_init(compressor_cb_t cb, int format, size_t maxiosize, int level,
if ((*iter)->format == format)
break;
}
if (iter == NULL)
if (iter == SET_LIMIT(compressors))
return (NULL);
priv = (*iter)->init(maxiosize, level);