summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-03-10 11:39:34 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-03-10 11:39:34 -0400
commitf9e9e5f9013cc2e9d238cbcad9a1dfaf3a529aac (patch)
tree386063e01fa49884140d1b18d4133705dbb9faed /src
parent43cd776d7dc8ac573262f8459edeb1c1f5f3cd09 (diff)
downloadbfs-f9e9e5f9013cc2e9d238cbcad9a1dfaf3a529aac.tar.xz
tests/xtime: Add tests for integer overflow
Diffstat (limited to 'src')
-rw-r--r--src/xtime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xtime.c b/src/xtime.c
index 8100f6c..05f0e1a 100644
--- a/src/xtime.c
+++ b/src/xtime.c
@@ -2,8 +2,9 @@
// SPDX-License-Identifier: 0BSD
#include "xtime.h"
-#include "atomic.h"
+#include "bfstd.h"
#include "config.h"
+#include "diag.h"
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
@@ -19,6 +20,7 @@ int xmktime(struct tm *tm, time_t *timep) {
struct tm tmp;
if (!localtime_r(timep, &tmp)) {
+ bfs_bug("localtime_r(-1): %s", xstrerror(errno));
return -1;
}