--- src/mm/chatty-sms-uri.c.orig 2024-08-22 02:36:26 +++ src/mm/chatty-sms-uri.c 2024-10-10 18:52:36 @@ -22,6 +22,15 @@ #include "chatty-sms-uri.h" #include "chatty-log.h" +#ifdef __APPLE__ +static const char *chatty_strchrnul(const char *s, int c) { + const char *ptr = strchr(s, c); + if (!ptr) + ptr = s + strlen(s); + return ptr; +} +#endif + /** * SECTION: chatty-sms-uri * @title: ChattySmsUri @@ -120,7 +129,11 @@ return; self->numbers_valid = TRUE; +#ifdef __APPLE__ + end = chatty_strchrnul (self->uri, '?'); +#else end = strchrnul (self->uri, '?'); +#endif numbers = g_strndup (self->uri, end - self->uri); number_start = numbers; @@ -172,7 +185,11 @@ goto end; body = body + strlen ("body="); + #ifdef __APPLE__ + end = chatty_strchrnul (body, '&'); + #else end = strchrnul (body, '&'); + #endif text = g_strndup (body, end - body); self->body = g_uri_unescape_string (text, NULL);