Commit ab207a1b authored by topjohnwu's avatar topjohnwu

va_list cannot be reused on x86

parent f152e8c3
...@@ -158,6 +158,9 @@ void setup_logfile(bool reset) { ...@@ -158,6 +158,9 @@ void setup_logfile(bool reset) {
} }
static int magisk_log(int prio, const char *fmt, va_list ap) { static int magisk_log(int prio, const char *fmt, va_list ap) {
va_list args;
va_copy(args, ap);
// Log to logcat // Log to logcat
__android_log_vprint(prio, "Magisk", fmt, ap); __android_log_vprint(prio, "Magisk", fmt, ap);
...@@ -185,7 +188,7 @@ static int magisk_log(int prio, const char *fmt, va_list ap) { ...@@ -185,7 +188,7 @@ static int magisk_log(int prio, const char *fmt, va_list ap) {
int ms = tv.tv_usec / 1000; int ms = tv.tv_usec / 1000;
len += sprintf(buf + len, ".%03d %c : ", ms, type); len += sprintf(buf + len, ".%03d %c : ", ms, type);
strcpy(buf + len, fmt); strcpy(buf + len, fmt);
return vfprintf(log_file, buf, ap); return vfprintf(log_file, buf, args);
} }
static void android_logging() { static void android_logging() {
......
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