1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Fix #915, string ends with

This commit is contained in:
winlin 2017-06-10 08:42:42 +08:00
parent 93710c7489
commit 372a9e5cb3

View file

@ -317,7 +317,8 @@ string srs_string_remove(string str, string remove_chars)
bool srs_string_ends_with(string str, string flag)
{
return str.rfind(flag) == str.length() - flag.length();
ssize_t pos = str.rfind(flag);
return (pos != string::npos) && (pos == str.length() - flag.length());
}
bool srs_string_ends_with(string str, string flag0, string flag1)