Ignore empty extra lines in train.txt

This commit is contained in:
AlexeyAB
2018-05-29 14:35:32 +03:00
parent 6fd90762c5
commit ec766fc3f1

View File

@ -46,10 +46,12 @@ char **get_random_paths(char **paths, int n, int m)
pthread_mutex_lock(&mutex); pthread_mutex_lock(&mutex);
//printf("n = %d \n", n); //printf("n = %d \n", n);
for(i = 0; i < n; ++i){ for(i = 0; i < n; ++i){
int index = random_gen() % m; do {
random_paths[i] = paths[index]; int index = random_gen() % m;
//if(i == 0) printf("%s\n", paths[index]); random_paths[i] = paths[index];
//printf("grp: %s\n", paths[index]); //if(i == 0) printf("%s\n", paths[index]);
//printf("grp: %s\n", paths[index]);
} while (strlen(random_paths[i]) == 0);
} }
pthread_mutex_unlock(&mutex); pthread_mutex_unlock(&mutex);
return random_paths; return random_paths;