chiark / gitweb /
util: an array with one entry is always ordered
authorLennart Poettering <lennart@poettering.net>
Thu, 21 May 2015 17:49:03 +0000 (19:49 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 08:57:27 +0000 (09:57 +0100)
src/shared/util.h

index abb36df..3aef47f 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);