Skip to content

Commit

Permalink
Restore q_strcasestr behavior with empty needle string
Browse files Browse the repository at this point in the history
This fixes occasional asserts in Con_AddToTabList after 22f4422
  • Loading branch information
andrei-drexler committed Dec 22, 2023
1 parent 22f4422 commit 20119ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Quake/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ char *q_strcasestr(const char *haystack, const char *needle)
{
const size_t len = strlen(needle);

if (!len)
return (char *)haystack;

while (*haystack)
{
if (!q_strncasecmp(haystack, needle, len))
Expand Down

0 comments on commit 20119ca

Please sign in to comment.