[FIX/CI] Make the C compiler less stupid

(You may notice that the dates for these commits are off. I'm
currently writing them without an Internet connection, and the
device I'm writing this through doesn't have an RTC. Oops!)
This commit is contained in:
LDA 2024-10-20 15:12:08 +02:00
commit 44d6df3be8
3 changed files with 29 additions and 12 deletions

View file

@ -588,7 +588,7 @@ ParseeUnlinkRoom(ParseeData *data, char *chat_id)
bool
ParseeIsMUCWhitelisted(ParseeData *data, char *muc)
{
char *server, *serv_start;
char *server, *serv_start, *postserv;
DbRef *ref;
bool ret;
if (!data || !muc)
@ -604,9 +604,10 @@ ParseeIsMUCWhitelisted(ParseeData *data, char *muc)
serv_start = strchr(muc, '@');
serv_start = serv_start ? serv_start : muc;
server = StrDuplicate(serv_start + 1);
if (strchr(server, '/'))
postserv = server ? strchr(server, '/') : NULL;
if (postserv) /* GCC doesn't know strchr is pure. */
{
*(strchr(server, '/')) = '\0';
*postserv = '\0';
}
ref = DbLockIntent(data->db,

View file

@ -121,7 +121,7 @@ ParseeVerifyAllStanza(ParseeData *args, XMLElement *stanza)
bool
ServerHasXEP421(ParseeData *data, char *from)
{
char *server = NULL, *parsee;
char *server = NULL, *postserv, *parsee;
XMLElement *disco;
bool ret = false;
if (!data || !from)
@ -140,9 +140,10 @@ ServerHasXEP421(ParseeData *data, char *from)
}
server = StrDuplicate(server);
if (strchr(server, '/'))
postserv = server ? strchr(server, '/') : NULL;
if (postserv)
{
*(strchr(server, '/')) = '\0';
*postserv = '\0';
}
parsee = ParseeJID(data);