Skip to content

Commit

Permalink
Secured some string references that was not const
Browse files Browse the repository at this point in the history
  • Loading branch information
grodansparadis committed Nov 16, 2023
1 parent 2ea2567 commit cfb750f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 79 deletions.
14 changes: 8 additions & 6 deletions src/vscp/common/mdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ write_data(void *ptr, size_t size, size_t nmemb, FILE *stream)
}

CURLcode
CMDF::downLoadMDF(std::string &url, std::string &tempFileName)
CMDF::downLoadMDF(const std::string &url, const std::string &tempFileName)
{
CURL *curl;
FILE *fp;
Expand All @@ -1433,9 +1433,10 @@ CMDF::downLoadMDF(std::string &url, std::string &tempFileName)
//

bool
CMDF::load(std::string &remoteFile, bool bLocalFile)
CMDF::load(const std::string &file, bool bLocalFile)
{
std::string localFile = remoteFile;
std::string remoteFile = file;
std::string localFile = file;

if (remoteFile.npos == remoteFile.find("http://")) {
std::string str;
Expand Down Expand Up @@ -7699,10 +7700,11 @@ CMDF::getDefaultRegisterValue(uint32_t reg, uint16_t page)
//

CMDF_RemoteVariable *
CMDF::getRemoteVariable(std::string name)
CMDF::getRemoteVariable(const std::string& name)
{
vscp_trim(name);
vscp_makeLower(name);
std::string remotevar = name;
vscp_trim(remotevar);
vscp_makeLower(remotevar);

std::deque<CMDF_RemoteVariable *>::iterator iter;
for (iter = m_list_remotevar.begin(); iter != m_list_remotevar.end(); ++iter) {
Expand Down
Loading

0 comments on commit cfb750f

Please sign in to comment.