Skip to content
This repository has been archived by the owner on Oct 10, 2019. It is now read-only.

Commit

Permalink
Remove char* from ttrss_api::url_to_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Minoru committed Oct 27, 2016
1 parent c04d52d commit dd99daa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ttrss_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,12 @@ bool ttrss_api::update_article(const std::string& guid, int field, int mode) {
}

std::string ttrss_api::url_to_id(const std::string& url) {
const char * uri = url.c_str();
const char * pound = strrchr(uri, '#');
if (!pound)
const std::string::size_type pound = url.find_first_of('#');
if (pound == std::string::npos) {
return "";
return std::string(pound+1);
} else {
return url.substr(pound+1);
}
}


Expand Down

0 comments on commit dd99daa

Please sign in to comment.