diff --git a/reactos/lib/msvcrt/mbstring/mbsrchr.c b/reactos/lib/msvcrt/mbstring/mbsrchr.c index e0486172186..c0f66f36376 100644 --- a/reactos/lib/msvcrt/mbstring/mbsrchr.c +++ b/reactos/lib/msvcrt/mbstring/mbsrchr.c @@ -10,32 +10,24 @@ #include -char *strrchr(const char* szSearch, int cFor); -extern int __mb_cur_max; - /* * @implemented */ unsigned char * _mbsrchr(const unsigned char *src, unsigned int val) { - if (__mb_cur_max > 1) + unsigned int c; + unsigned char *match = NULL; + + if (!src) + return NULL; + + while (1) { - unsigned int c; - unsigned char *match = NULL; - - if (!src) - return NULL; - - while (1) - { - c = _mbsnextc(src); - if (c == val) - match = (unsigned char*)src; - if (!c) - return match; - src += (c > 255) ? 2 : 1; - } + c = _mbsnextc(src); + if (c == val) + match = (unsigned char*)src; + if (!c) + return match; + src += (c > 255) ? 2 : 1; } - - return strrchr(src, val); }