From 523944d96e11bde68bf9bcf8e42b7ebc99c5ed3d Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 11 Jun 2024 13:44:02 -0400 Subject: fix ctype epoch on first call --- src/stdlib/_stdlib.h | 3 +++ 1 file changed, 3 insertions(+) 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()) { \ -- cgit v1.2.1