Module Name: src
Committed By: christos
Date: Tue Sep 18 22:12:19 UTC 2018
Modified Files:
src/external/bsd/blacklist/bin: support.c
Log Message:
fix ymdhms calculation
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/blacklist/bin/support.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/blacklist/bin/support.c
diff -u src/external/bsd/blacklist/bin/support.c:1.8 src/external/bsd/blacklist/bin/support.c:1.9
--- src/external/bsd/blacklist/bin/support.c:1.8 Mon Apr 4 11:52:56 2016
+++ src/external/bsd/blacklist/bin/support.c Tue Sep 18 18:12:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: support.c,v 1.8 2016/04/04 15:52:56 christos Exp $ */
+/* $NetBSD: support.c,v 1.9 2018/09/18 22:12:19 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: support.c,v 1.8 2016/04/04 15:52:56 christos Exp $");
+__RCSID("$NetBSD: support.c,v 1.9 2018/09/18 22:12:19 christos Exp $");
#include <time.h>
#include <string.h>
@@ -105,12 +105,16 @@ fmtydhms(char *b, size_t l, time_t t)
s = t % 60;
t /= 60;
+
m = t % 60;
t /= 60;
- h = t % 60;
+
+ h = t % 24;
t /= 24;
- d = t % 24;
- t /= 356;
+
+ d = t % 365;
+ t /= 365;
+
y = t;
z = 0;