fix too many or too few labels error for both linux and windows

This commit is contained in:
nguyentienanh2303 2020-09-02 15:32:24 +07:00
parent 20bb55c69e
commit 5e1c126bfc

View File

@ -545,7 +545,7 @@ void fill_truth(char *path, char **labels, int k, float *truth)
int i;
char *filename = "";
for (i = strlen(path) - 1; i >= 0; --i) {
if (path[i] == '/') {
if (path[i] == '/' || path[i] == '\\') {
filename = malloc(strlen(path + i) + 1);
strcpy(filename, path + i + 1);
break;