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.
This commit is contained in:
jp9000 2015-01-02 21:03:53 -08:00
parent f2287c8a28
commit 9a91bbc16c
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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);