Supply strchrnul() for platforms apparently missing it
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 6 Dec 2023 12:25:14 +0000 (12:25 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Wed, 6 Dec 2023 12:26:38 +0000 (12:26 +0000)
Broken-by: 2658a023286f
src/OS/os.h-FreeBSD
src/OS/os.h-Linux
src/src/os.c

index 6756d42f66ae7d4ff4f212f3785b750a103e40a5..11f8b1ae7ce824deb45ff74d308e64cc36bde666 100644 (file)
@@ -78,5 +78,7 @@ extern ssize_t os_sendfile(int, int, off_t *, size_t);
 /*******************/
 
 #define EXIM_HAVE_KEVENT
+#define EXIM_HAVE_STRCHRNUL
+
 
 /* End */
index 25a12862b8d7c2e8d880f43c151e6a8295e8b617..cebda33674bcbc5b0fe029669081ba5b6f1750f9 100644 (file)
@@ -102,4 +102,6 @@ then change the 0 to 1 in the next block. */
 # define NS_MAXMSG 65535
 #endif
 
+#define EXIM_HAVE_STRCHRNUL
+
 /* End */
index 5c52c6d4d44d509a4f223069f36d100506f2c36d..5e5899eeb8709be9c91f405b3d8fcb5015f8f2c1 100644 (file)
@@ -893,6 +893,21 @@ return buffer ? buffer : realloc(b, strlen(b) + 1);
 #endif
 
 /* ----------------------------------------------------------------------- */
+/***********************************************************
+*             strchrnul()                                  *
+***********************************************************/
+
+#if !defined(EXIM_HAVE_STRCHRNUL)
+char *
+strchrnul(const char * s, int c)
+{
+while (*s != c && *s) s++
+return CS s;
+}
+#endif
+
+
+/* ----------------------------------------------------------------------- */