From 3c99b28ee58a3e5c74507d65d448fbff4e509f30 Mon Sep 17 00:00:00 2001 From: "Gary E. Miller" Date: Fri, 14 Dec 2018 13:38:43 -0800 Subject: gpspipe: Change gmtime() to gmtime_r(). Some code checkers complain that gmtime() is not thread safe. Like we care in gpspipe. --- gpspipe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gpspipe.c') diff --git a/gpspipe.c b/gpspipe.c index 194b3a92..9df4abd7 100644 --- a/gpspipe.c +++ b/gpspipe.c @@ -361,12 +361,12 @@ int main(int argc, char **argv) if (new_line && timestamp) { char tmstr_u[40]; // time with "usec" resolution struct timespec now; - struct tm *tmp_now; + struct tm tmp_now; int written; (void)clock_gettime(CLOCK_REALTIME, &now); - tmp_now = gmtime((time_t *)&(now.tv_sec)); - (void)strftime(tmstr, sizeof(tmstr), format, tmp_now); + (void)gmtime_r((time_t *)&(now.tv_sec), &tmp_now); + (void)strftime(tmstr, sizeof(tmstr), format, &tmp_now); new_line = 0; switch( option_u ) { -- cgit v1.2.1