para_server: New command line option: --autoplay_delay
[paraslash.git] / random_selector.c
index 3bd637d..7bf3402 100644 (file)
@@ -27,7 +27,6 @@
 #include "string.h"
 
 static int com_random_info(int, int, char **);
-extern struct gengetopt_args_info conf;
 extern struct misc_meta_data *mmd;
 
 static unsigned int num_audio_files, audio_file_count;
@@ -41,10 +40,11 @@ static int count_audio_files(__a_unused const char *dir, __a_unused const char *
 
 static int remember_file(const char *dir, const char *name)
 {
-       if (audio_file_count >= num_audio_files)
-               return -E_FILE_COUNT;
-       audio_file_list[audio_file_count] = make_message("%s/%s", dir, name);
-       audio_file_count++;
+       if (audio_file_count < num_audio_files) {
+               audio_file_list[audio_file_count] =
+                       make_message("%s/%s", dir, name);
+               audio_file_count++;
+       }
        return 1;
 }