/* Copyright (c) Microsoft Corporation. All rights reserved. */
#include <string.h>
#include <tchar.h>

/* String searching functions as per ISO/IEC 9899 section 7.11.5 */

/* 7.11.5.7. Search for s2 in s1. */
_TCHAR *  __cdecl _tcsstr(const _TCHAR *s1, const _TCHAR *s2)
{
    int len2 = _tcslen(s2);
    for (;;) {
        s1 = (const _TCHAR *) _tcschr(s1, s2[0]);
        if (s1 == NULL)
            return NULL;
        if (!_tcsncmp(s1, s2, len2))
            return (_TCHAR *) s1;
        s1++;
    }
}