mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-25 06:00:35 +01:00
42 lines
566 B
C
42 lines
566 B
C
/*
|
|
WCSSTR.C
|
|
|
|
symbols in this file:
|
|
_wcsstr (.text, 0x5E)
|
|
*/
|
|
|
|
/* ---------- types */
|
|
|
|
typedef unsigned short wchar_t;
|
|
|
|
/* ---------- public code */
|
|
|
|
wchar_t * __cdecl wcsstr(
|
|
wchar_t const *string,
|
|
wchar_t const *substring)
|
|
{
|
|
wchar_t const *candidate = string;
|
|
|
|
if (!*substring)
|
|
return (wchar_t *)string;
|
|
|
|
while (*candidate)
|
|
{
|
|
wchar_t const *left = candidate;
|
|
wchar_t const *right = substring;
|
|
|
|
while (*left && *right && !(*left - *right))
|
|
{
|
|
left++;
|
|
right++;
|
|
}
|
|
|
|
if (!*right)
|
|
return (wchar_t *)candidate;
|
|
|
|
candidate++;
|
|
}
|
|
|
|
return 0;
|
|
}
|