From ccad164a0a43a9a026af76d61b35068e7b5d3ab8 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 8 May 2021 13:40:48 +0200 Subject: [PATCH] Escape spaces in cubemap-input.stats. --- input_stats.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/input_stats.cpp b/input_stats.cpp index eee597b..5b7dc59 100644 --- a/input_stats.cpp +++ b/input_stats.cpp @@ -52,7 +52,14 @@ void InputStatsThread::do_work() now = time(nullptr); for (size_t i = 0; i < inputs.size(); ++i) { InputStats stats = inputs[i]->get_stats(); - fprintf(fp, "%s %llu %llu", stats.url.c_str(), + for (const char ch : stats.url) { + if (isspace(ch) || !isprint(ch)) { + putc('_', fp); + } else { + putc(ch, fp); + } + } + fprintf(fp, " %llu %llu", (long long unsigned)(stats.bytes_received), (long long unsigned)(stats.data_bytes_received)); if (stats.connect_time == -1) { -- 2.39.2