fix too many or too few labels error when train a classifier for both linux and windows

This commit is contained in:
nguyentienanh2303 2020-09-02 15:46:54 +07:00
parent 5e1c126bfc
commit 8ea29e0f3e

View File

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