fdlist: consider NULL to be the empty list for the sake of fdlist_count()
This avoids the user having to special case the list not being allocated.
@@ -25,6 +25,9 @@ static inline int *fdlist_data(FDList *list) {
}
static inline size_t fdlist_count(FDList *list) {
+ if (!list)
+ return 0;
+ else
return (list->cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int);
}
