commit d2f35ef7f79f7511fae51312769f01f12f9a793e from: Christian Weisgerber via: Thomas Adam date: Sun Feb 13 00:43:46 2022 UTC shrink the width of formatted output fields to their expected size Replace FMT_SCALED_STRSIZE with (FMT_SCALED_STRSIZE - 2) as field width when formatting output for printing. FMT_SCALED_STRSIZE includes space for a nul byte and a minus sign. Output values are expected to be always positive here. ok stsp commit - 90dfa2bf41872a0f074ac2cea3b45d6ba3c77de6 commit + d2f35ef7f79f7511fae51312769f01f12f9a793e blob - 1cdbbce8bd9b2dfdca4bdf6df73b4f3cdf7c6979 blob + 5be6a46cba0106ad052f2b730fe0227639eccb29 --- got/got.c +++ got/got.c @@ -1029,7 +1029,7 @@ fetch_progress(void *arg, const char *message, off_t p if (print_size || print_indexed || print_resolved) printf("\r"); if (print_size) - printf("%*s fetched", FMT_SCALED_STRSIZE, scaled_size); + printf("%*s fetched", FMT_SCALED_STRSIZE - 2, scaled_size); if (print_indexed) printf("; indexing %d%%", p_indexed); if (print_resolved) @@ -7818,10 +7818,10 @@ send_progress(void *arg, off_t packfile_size, int ncom if (print_deltify) printf("; deltify: %d%%", p_deltify); if (print_sent) - printf("; uploading pack: %*s %d%%", FMT_SCALED_STRSIZE, + printf("; uploading pack: %*s %d%%", FMT_SCALED_STRSIZE - 2, scaled_packsize, p_sent); else if (print_written) - printf("; writing pack: %*s %d%%", FMT_SCALED_STRSIZE, + printf("; writing pack: %*s %d%%", FMT_SCALED_STRSIZE - 2, scaled_packsize, p_written); if (print_searching || print_total || print_deltify || print_written || print_sent) { blob - 938baf072aa45776f93886d1d0df6671f3de3c56 blob + 685896f0638c6b007486f72cbba47e46ddb81a9e --- gotadmin/gotadmin.c +++ gotadmin/gotadmin.c @@ -457,7 +457,7 @@ pack_progress(void *arg, off_t packfile_size, int ncom if (print_deltify) printf("; deltify: %d%%", p_deltify); if (print_written) - printf("; writing pack: %*s %d%%", FMT_SCALED_STRSIZE, + printf("; writing pack: %*s %d%%", FMT_SCALED_STRSIZE - 2, scaled_size, p_written); if (print_searching || print_total || print_deltify || print_written) { @@ -511,7 +511,7 @@ pack_index_progress(void *arg, off_t packfile_size, in if (print_size || print_indexed || print_resolved) printf("\r"); if (print_size) - printf("%*s packed", FMT_SCALED_STRSIZE, scaled_size); + printf("%*s packed", FMT_SCALED_STRSIZE - 2, scaled_size); if (print_indexed) printf("; indexing %d%%", p_indexed); if (print_resolved)