@@ -156,7 +156,7 @@ static bool range_exists(struct commonio_db *db, const char *owner)
156156{
157157 const struct subordinate_range * range ;
158158 commonio_rewind (db );
159- while ((range = commonio_next (db )) != NULL ) {
159+ while (NULL != (range = commonio_next (db ))) {
160160 if (streq (range -> owner , owner ))
161161 return true;
162162 }
@@ -188,7 +188,7 @@ static const struct subordinate_range *find_range(struct commonio_db *db,
188188 * before.
189189 */
190190 commonio_rewind (db );
191- while ((range = commonio_next (db )) != NULL ) {
191+ while (NULL != (range = commonio_next (db ))) {
192192 unsigned long first = range -> start ;
193193 unsigned long last = first + range -> count - 1 ;
194194
@@ -229,7 +229,7 @@ static const struct subordinate_range *find_range(struct commonio_db *db,
229229 return NULL ;
230230
231231 commonio_rewind (db );
232- while ((range = commonio_next (db )) != NULL ) {
232+ while (NULL != (range = commonio_next (db ))) {
233233 unsigned long first = range -> start ;
234234 unsigned long last = first + range -> count - 1 ;
235235
@@ -366,7 +366,7 @@ static unsigned long find_free_range(struct commonio_db *db,
366366 commonio_rewind (db );
367367
368368 low = min ;
369- while ((range = commonio_next (db )) != NULL ) {
369+ while (NULL != (range = commonio_next (db ))) {
370370 unsigned long first = range -> start ;
371371 unsigned long last = first + range -> count - 1 ;
372372
@@ -884,7 +884,7 @@ int list_owner_ranges(const char *owner, enum subid_type id_type, struct subid_r
884884 have_owner_id = get_owner_id (owner , id_type , id );
885885
886886 commonio_rewind (db );
887- while ((range = commonio_next (db )) != NULL ) {
887+ while (NULL != (range = commonio_next (db ))) {
888888 if (streq (range -> owner , owner )) {
889889 if (!append_range (& ranges , range , count ++ )) {
890890 free (ranges );
@@ -989,7 +989,7 @@ int find_subid_owners(unsigned long id, enum subid_type id_type, uid_t **uids)
989989 * uids = NULL ;
990990
991991 commonio_rewind (db );
992- while ((range = commonio_next (db )) != NULL ) {
992+ while (NULL != (range = commonio_next (db ))) {
993993 if (id >= range -> start && id < range -> start + range -> count ) {
994994 n = append_uids (uids , range -> owner , n );
995995 if (n < 0 )
@@ -1045,7 +1045,7 @@ bool new_subid_range(struct subordinate_range *range, enum subid_type id_type, b
10451045
10461046 commonio_rewind (db );
10471047 if (reuse ) {
1048- while ((r = commonio_next (db )) != NULL ) {
1048+ while (NULL != (r = commonio_next (db ))) {
10491049 // TODO account for username vs uid_t
10501050 if (!streq (r -> owner , range -> owner ))
10511051 continue ;
0 commit comments