标签:const use name opp zed exist write erro span
1 yl::string CBaseAutopProcessor::AddAuthorizedInfo(const yl::string & strOriginalUrl, 2 const yl::string & strUserName, const yl::string & strPassword) 3 { 4 yl::string strUrl = strOriginalUrl;//cow exist error 5 6 if (strOriginalUrl.empty() 7 || strUserName.empty()) 8 { 9 return strUrl; 10 } 11 12 char * pBuf = (char *) strUrl.c_str(); 13 char * pTemp = NULL; 14 if ((pTemp = strstr(pBuf, "://")) != NULL) 15 { 16 *pTemp = ‘\0‘; //cow will cause strUrl and strOriginalUrl change 17 pTemp += 3; 18 19 // 加入用户名和密码 20 char bufURL[512] = {0}; 21 sprintf(bufURL, "%s://%s:%s@%s", pBuf, strUserName.c_str(), strPassword.c_str(), pTemp); 22 strUrl = bufURL; 23 } 24 25 return strUrl; 26 }
标签:const use name opp zed exist write erro span
原文地址:https://www.cnblogs.com/blog-yejy/p/9285738.html