Commit 558e6b78 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

filesystem: avoid potential qsort(NULL)

parent 9fea6f98
...@@ -153,7 +153,7 @@ int vlc_loaddir( DIR *dir, char ***namelist, ...@@ -153,7 +153,7 @@ int vlc_loaddir( DIR *dir, char ***namelist,
num++; num++;
} }
if (compar != NULL) if (compar != NULL && num > 0)
qsort (tab, num, sizeof (*tab), qsort (tab, num, sizeof (*tab),
(int (*)( const void *, const void *))compar); (int (*)( const void *, const void *))compar);
*namelist = tab; *namelist = tab;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment