afb-evt: fix a bug discovered by clang-check
[src/app-framework-binder.git] / src / locale-root.c
index ece4456..8386e66 100644 (file)
@@ -263,7 +263,8 @@ static int init_container(struct locale_container *container, int dirfd)
        }
 
        /* sort the folders */
-       qsort(container->folders, container->count, sizeof *container->folders, compare_folders_for_qsort);
+       if (container->count)
+               qsort(container->folders, container->count, sizeof *container->folders, compare_folders_for_qsort);
 
        /* build the parents links */
        i = container->count;