提交 9a91bbc1 编写于 作者: J jp9000

libobs: Make astrstri a bit more C-compliant

I actually kind of hate how strstr returns a non-const even though it
takes a const parameter, but I can understand why they made it that way.
They really should have split it in to two functions though, one const
and one non-const or something.  But alas, ultimately for a C programmer
who knows what they're doing it isn't a huge deal.
上级 f2287c8a
......@@ -162,7 +162,7 @@ int wstrcmpi_n(const wchar_t *str1, const wchar_t *str2, size_t n)
return 0;
}
char *astrstri(char *str, const char *find)
char *astrstri(const char *str, const char *find)
{
size_t len;
......@@ -173,7 +173,7 @@ char *astrstri(char *str, const char *find)
do {
if (astrcmpi_n(str, find, len) == 0)
return str;
return (char*)str;
} while (*str++);
return NULL;
......
......@@ -46,7 +46,7 @@ EXPORT int wstrcmp_n(const wchar_t *str1, const wchar_t *str2, size_t n);
EXPORT int astrcmpi_n(const char *str1, const char *str2, size_t n);
EXPORT int wstrcmpi_n(const wchar_t *str1, const wchar_t *str2, size_t n);
EXPORT char *astrstri(char *str, const char *find);
EXPORT char *astrstri(const char *str, const char *find);
EXPORT char *strdepad(char *str);
EXPORT wchar_t *wcsdepad(wchar_t *str);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册