]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Revert HSv3 stats string formatting to its old %u self.
authorGeorge Kadianakis <desnacked@riseup.net>
Wed, 4 Nov 2020 13:28:23 +0000 (15:28 +0200)
committerGeorge Kadianakis <desnacked@riseup.net>
Mon, 23 Nov 2020 11:35:26 +0000 (13:35 +0200)
The rest of rephist.c is doing the same kind of unsigned casting. For example
see rep_hist_format_buffer_stats() and rep_hist_format_exit_stats().

The previous switch to %ld made Appveyor fail:
    https://ci.appveyor.com/project/torproject/tor/builds/36118502

src/feature/stats/rephist.c

index 59f38fe60311debc0e1030a3418a54f7528a828e..f8d7887e65034cd69853577e0f457f5b6ec08ef9 100644 (file)
@@ -2009,11 +2009,11 @@ rep_hist_format_hs_stats(time_t now, bool is_v3)
                            ONIONS_SEEN_EPSILON);
 
   format_iso_time(t, now);
-  tor_asprintf(&hs_stats_string, "%s %s (%ld s)\n"
+  tor_asprintf(&hs_stats_string, "%s %s (%u s)\n"
                "%s %"PRId64" delta_f=%d epsilon=%.2f bin_size=%d\n"
                "%s %"PRId64" delta_f=%d epsilon=%.2f bin_size=%d\n",
                is_v3 ? "hidserv-v3-stats-end" : "hidserv-stats-end",
-               t, now - start_of_hs_stats_interval,
+               t, (unsigned) (now - start_of_hs_stats_interval),
                is_v3 ?
                 "hidserv-rend-v3-relayed-cells" : "hidserv-rend-relayed-cells",
                obfuscated_cells_seen, REND_CELLS_DELTA_F,