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:
Mark Johnston
2018-02-15 17:35:40 +00:00
parent a170bb0387
commit 05f0f0e9ea
+1 -1
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);