Make sure logs are always ended with newline

This commit is contained in:
topjohnwu
2022-09-09 04:29:50 -07:00
parent 44029875a6
commit a66a3b7438
19 changed files with 76 additions and 47 deletions

View File

@@ -164,7 +164,7 @@ void install_apk(const char *apk) {
.fork = fork_no_orphan
};
char cmds[sizeof(install_script) + 4096];
snprintf(cmds, sizeof(cmds), install_script, apk, JAVA_PACKAGE_NAME);
ssprintf(cmds, sizeof(cmds), install_script, apk, JAVA_PACKAGE_NAME);
exec_command_sync(exec, "/system/bin/sh", "-c", cmds);
}
@@ -179,7 +179,7 @@ void uninstall_pkg(const char *pkg) {
.fork = fork_no_orphan
};
char cmds[sizeof(uninstall_script) + 256];
snprintf(cmds, sizeof(cmds), uninstall_script, pkg);
ssprintf(cmds, sizeof(cmds), uninstall_script, pkg);
exec_command_sync(exec, "/system/bin/sh", "-c", cmds);
}
@@ -195,7 +195,7 @@ void clear_pkg(const char *pkg, int user_id) {
.fork = fork_no_orphan
};
char cmds[sizeof(clear_script) + 288];
snprintf(cmds, sizeof(cmds), clear_script, pkg, user_id);
ssprintf(cmds, sizeof(cmds), clear_script, pkg, user_id);
exec_command_sync(exec, "/system/bin/sh", "-c", cmds);
}