Skip to content
Snippets Groups Projects
Commit af812cd2 authored by Timo Teräs's avatar Timo Teräs
Browse files

print: simplify code a little bit

parent 5d978c2a
No related branches found
No related tags found
No related merge requests found
...@@ -203,9 +203,9 @@ static void apk_out_render_progress(struct apk_out *out, bool force) ...@@ -203,9 +203,9 @@ static void apk_out_render_progress(struct apk_out *out, bool force)
static void log_internal(FILE *dest, const char *prefix, const char *format, va_list va) static void log_internal(FILE *dest, const char *prefix, const char *format, va_list va)
{ {
if (prefix != NULL && prefix != APK_OUT_LOG_ONLY && prefix[0] != 0) fprintf(dest, "%s", prefix); if (prefix != NULL && prefix != APK_OUT_LOG_ONLY && prefix[0] != 0) fputs(prefix, dest);
vfprintf(dest, format, va); vfprintf(dest, format, va);
fprintf(dest, "\n"); fputc('\n', dest);
fflush(dest); fflush(dest);
} }
...@@ -235,9 +235,7 @@ void apk_out_log_argv(struct apk_out *out, char **argv) ...@@ -235,9 +235,7 @@ void apk_out_log_argv(struct apk_out *out, char **argv)
if (!out->log) return; if (!out->log) return;
fprintf(out->log, "\nRunning `"); fprintf(out->log, "\nRunning `");
for (int i = 0; argv[i]; ++i) { for (int i = 0; argv[i]; ++i) fprintf(out->log, "%s%s", argv[i], argv[i+1] ? " " : "");
fprintf(out->log, "%s%s", argv[i], argv[i+1] ? " " : "");
}
gmtime_r(&now, &tm); gmtime_r(&now, &tm);
strftime(when, sizeof(when), "%Y-%m-%d %H:%M:%S", &tm); strftime(when, sizeof(when), "%Y-%m-%d %H:%M:%S", &tm);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment