Fix bug in MagiskBoot

This commit is contained in:
topjohnwu
2018-10-26 17:02:07 -04:00
parent 958d6377e3
commit 6add02702b
3 changed files with 19 additions and 11 deletions

View File

@ -211,9 +211,10 @@ bool cpio::mv(const char *from, const char *to) {
delete arr[t];
arr[t] = nullptr;
}
free(arr[f]->filename);
arr[f]->filename = strdup(to);
fprintf(stderr, "Move [%s] -> [%s]\n", from, to);
char * tmp = strdup(to);
free(arr[f]->filename);
arr[f]->filename = tmp;
return true;
}
fprintf(stderr, "Cannot find entry %s\n", from);