X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=random_selector.c;h=7bf34026941f8fcfa0553e26c69b3e66a7a5830e;hp=123425b0b8d3df18a5b624481babd5e2ae61b666;hb=0c4a3b0f50cf6cdf21e13441b76b7bf963cd6876;hpb=6570e0e4433a5e5d7987697716a1f993c96eb1bb diff --git a/random_selector.c b/random_selector.c index 123425b0..7bf34026 100644 --- a/random_selector.c +++ b/random_selector.c @@ -40,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; }