From cc6e7378d3f5473137e0c46d39173e6f60dcefda Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 30 Jan 2024 14:57:46 -0500 Subject: update standards and safety checks --- src/stdlib/bsearch.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/stdlib/bsearch.c') diff --git a/src/stdlib/bsearch.c b/src/stdlib/bsearch.c index 39bf7694..a7531672 100644 --- a/src/stdlib/bsearch.c +++ b/src/stdlib/bsearch.c @@ -1,6 +1,5 @@ -#if 0 - #include +#include "_stdlib.h" /** binary search **/ @@ -12,6 +11,8 @@ void * bsearch(const void * key, const void * base, size_t nmemb, size_t size, i unsigned int trip = 1; const char *addr = base; + SIGNAL_SAFE(0); + while (ret == NULL) { int comp = compar(key, addr + (i * size)); if (comp == 0) { @@ -44,6 +45,3 @@ RETURN_FAILURE(CONSTANT(NULL)) RETURN_SUCCESS(a pointer to the matching element) STDC(1) */ - - -#endif -- cgit v1.2.1