get rid of all mysterious numbers that meant length of string literals

This commit is contained in:
Andrzej Rybczak
2009-09-15 23:12:45 +00:00
parent 6e903f9fc8
commit 61a9d6a785
4 changed files with 18 additions and 13 deletions

View File

@@ -209,8 +209,8 @@ void *Lyrics::Get(void *screen_void_ptr)
char *c_title = curl_easy_escape(0, title.c_str(), title.length());
std::string url = my_lyrics->url;
url.replace(url.find("%artist%"), 8, c_artist);
url.replace(url.find("%title%"), 7, c_title);
url.replace(url.find("%artist%"), static_strlen("%artist%"), c_artist);
url.replace(url.find("%title%"), static_strlen("%title%"), c_title);
CURLcode code;
pthread_mutex_lock(&CurlLock);
@@ -247,9 +247,9 @@ void *Lyrics::Get(void *screen_void_ptr)
}
for (size_t i = result.find("<"); i != std::string::npos; i = result.find("<"))
result.replace(i, 4, "<");
result.replace(i, static_strlen("&lt;"), "<");
for (size_t i = result.find("&gt;"); i != std::string::npos; i = result.find("&gt;"))
result.replace(i, 4, ">");
result.replace(i, static_strlen("&gt;"), ">");
EscapeHtml(result);
Trim(result);