From: Sami Kerola Date: Tue, 16 Aug 2016 12:40:19 +0000 (+0100) Subject: cleanup: remove unnecessary function X-Git-Tag: v0.88~38^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F136%2Fhead;p=thirdparty%2Fmtr.git cleanup: remove unnecessary function --- diff --git a/report.c b/report.c index 2f03019..67bf27c 100644 --- a/report.c +++ b/report.c @@ -48,19 +48,15 @@ extern int af; extern int reportwide; -char *get_time_string (void) -{ - time_t now; - char *t; - now = time (NULL); - t = ctime (&now); - t [ strlen (t) -1] = 0; // remove the trailing newline - return t; -} - void report_open(void) { - printf ("Start: %s\n", get_time_string ()); + const time_t now = time(NULL); + char *t = ctime (&now); + const size_t len = strlen(t); + + if (t[len - 1] == '\n') + t[len - 1] = '\0'; + printf ("Start: %s\n", t); } static size_t snprint_addr(char *dst, size_t dst_len, ip_t *addr)