aboutsummaryrefslogtreecommitdiffstats
path: root/timevaltostr.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-08-26 12:49:12 +0200
committerMattias Andrée <maandree@kth.se>2018-08-26 12:49:12 +0200
commitf2378869e1a3b1cb44b5c7973e0a9acfb2559d0f (patch)
treee8caadeb4359bb62c7ba0b13ce94704220dd9ac7 /timevaltostr.c
parentTests and minor improvements (diff)
downloadlibsimple-f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f.tar.gz
libsimple-f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f.tar.bz2
libsimple-f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f.tar.xz
Fixes, more test, and add minimise_number_string
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--timevaltostr.c4
1 files changed, 2 insertions, 2 deletions
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;