From f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 26 Aug 2018 12:49:12 +0200 Subject: Fixes, more test, and add minimise_number_string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- timevaltostr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'timevaltostr.c') diff --git a/timevaltostr.c b/timevaltostr.c index 4dd6b9c..5daace5 100644 --- a/timevaltostr.c +++ b/timevaltostr.c @@ -3,13 +3,13 @@ char * -libsimple_timevaltostr(char *restrict buf, const struct timeval *restrict tv) /* TODO test */ +libsimple_timevaltostr(char *restrict buf, const struct timeval *restrict tv) { time_t s = tv->tv_sec; long int us = tv->tv_usec; char sign[2] = "+"; - if (!s) { + if (!buf) { buf = malloc(INTSTRLEN(time_t) + sizeof("-.999999")); if (!buf) return NULL; -- cgit v1.2.3-70-g09d2