summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-06-11 13:44:02 -0400
committerJakob Kaivo <jkk@ung.org>2024-06-11 13:44:02 -0400
commit523944d96e11bde68bf9bcf8e42b7ebc99c5ed3d (patch)
treea479f5811ecb10df3057675b5e6e53e4d8d25101
parenta550833c70541ca909fc3d07771680b4162b6b41 (diff)
fix ctype epoch on first call
-rw-r--r--src/stdlib/_stdlib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stdlib/_stdlib.h b/src/stdlib/_stdlib.h
index 64e64abd..75210bbf 100644
--- a/src/stdlib/_stdlib.h
+++ b/src/stdlib/_stdlib.h
@@ -9,6 +9,9 @@
#ifndef NDEBUG
#define ASSERT_CTYPE(__s_ptr) do { \
static unsigned int __ctype_epoch = 0; \
+ if (__ctype_epoch == 0) { \
+ __ctype_epoch = __get_ctype_epoch(); \
+ } \
if ((__s_ptr) == 0) { \
__ctype_epoch = __get_ctype_epoch(); \
} else if (__ctype_epoch != __get_ctype_epoch()) { \