Commit 82ea9db9 authored by topjohnwu's avatar topjohnwu

Don't override arguments

parent c5758b3f
...@@ -386,8 +386,8 @@ bool MagiskInit::read_dt_fstab(const char *name, char *partname, char *partfs) { ...@@ -386,8 +386,8 @@ bool MagiskInit::read_dt_fstab(const char *name, char *partname, char *partfs) {
read(fd, path, sizeof(path)); read(fd, path, sizeof(path));
close(fd); close(fd);
// Some custom treble use different names, so use what we read // Some custom treble use different names, so use what we read
name = rtrim(strrchr(path, '/') + 1); char *part = rtrim(strrchr(path, '/') + 1);
sprintf(partname, "%s%s", name, strend(name, cmd.slot) ? cmd.slot : ""); sprintf(partname, "%s%s", part, strend(part, cmd.slot) ? cmd.slot : "");
sprintf(path, "%s/fstab/%s/type", cmd.dt_dir, name); sprintf(path, "%s/fstab/%s/type", cmd.dt_dir, name);
if ((fd = xopen(path, O_RDONLY | O_CLOEXEC)) >= 0) { if ((fd = xopen(path, O_RDONLY | O_CLOEXEC)) >= 0) {
read(fd, partfs, 32); read(fd, partfs, 32);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment