summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2016-09-19 12:48:21 +0000
committermillert <millert@openbsd.org>2016-09-19 12:48:21 +0000
commit2299c0912663914911c313392b54e124e9a552ac (patch)
tree8a58bc1f4681beae8ca6a6dba12188a9b361f007 /lib/libc
parentDon't build saveFP/restFP for powerpc. Not needed on OpenBSD. (diff)
downloadwireguard-openbsd-2299c0912663914911c313392b54e124e9a552ac.tar.xz
wireguard-openbsd-2299c0912663914911c313392b54e124e9a552ac.zip
gmtime_r() should return NULL on failure, not the struct tm * result
parameter that was passed in. From Carlin Bingham.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/time/localtime.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c
index f05340db3b9..2334b7465b7 100644
--- a/lib/libc/time/localtime.c
+++ b/lib/libc/time/localtime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: localtime.c,v 1.58 2016/03/14 15:26:52 mestre Exp $ */
+/* $OpenBSD: localtime.c,v 1.59 2016/09/19 12:48:21 millert Exp $ */
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson.
@@ -1350,8 +1350,7 @@ gmtsub(const time_t *timep, long offset, struct tm *tmp)
struct tm *
gmtime_r(const time_t *timep, struct tm *p_tm)
{
- gmtsub(timep, 0L, p_tm);
- return p_tm;
+ return gmtsub(timep, 0L, p_tm);
}
DEF_WEAK(gmtime_r);