chiark / gitweb /
util: an array with one entry is always ordered
[elogind.git] / src / shared / util.h
index abb36dfef5e9dce159c2f271812167f4a9903e44..3aef47f37d36accaa38ed8e883fe514e62afc8ca 100644 (file)
@@ -775,7 +775,7 @@ int shall_restore_state(void);
  * that only if nmemb > 0.
  */
 static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
-        if (nmemb <= 0)
+        if (nmemb <= 1)
                 return;
 
         assert(base);