From 9d73cf08bc97e230ad334f5fc5d7576432306adf Mon Sep 17 00:00:00 2001 From: Carlo Marcelo Arenas Belon Date: Fri, 28 Sep 2018 10:04:39 -0700 Subject: [PATCH] tools: allow short SHA1 longer than 7 (#1399) newer versions of git use a variable lenght proportional to the repository size (9 for cppcheck) remove old chomp helper function and make copying the revision smarter to hopefully cover for edge case that needed it --- tools/times.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/times.c b/tools/times.c index 23e56ffbe..446227dce 100644 --- a/tools/times.c +++ b/tools/times.c @@ -2,11 +2,11 @@ #include #include -char *replace(char *str, char before, char after) +static void revncpy(char *dst, const char *src, size_t len) { - while (strchr(str,before)) - *strchr(str,before) = after; - return str; + int n = 0; + while (n++