Fix some more breakage

This commit is contained in:
Vedran Ljubovic 2006-08-26 17:32:02 +00:00
parent dbdc0decd4
commit 97a5e106e5

View File

@ -369,14 +369,14 @@ bool Config::read_file(bool create)
else if ((c == '=') || (c == ':')) else if ((c == '=') || (c == ':'))
iskey = false; iskey = false;
else { else {
if (issection) if (issection) {
if (maxlen>strlen(sectionname)+strlen((const char*) &c)) if (maxlen>strlen(sectionname)+1)
strcat(sectionname, (const char*) &c); strcat(sectionname, (const char*) &c);
else if (iskey) } else if (iskey) {
if (maxlen>strlen(key)+strlen((const char*) &c)) if (maxlen>strlen(key)+1)
strcat(key, (const char*) &c); strcat(key, (const char*) &c);
else } else
if (maxlen>strlen(value)+strlen((const char*) &c)) if (maxlen>strlen(value)+1)
strcat(value, (const char*) &c); strcat(value, (const char*) &c);
} }
} }
@ -855,7 +855,10 @@ char* Config_Section::find_entry(const char *key) const
char *ret; char *ret;
char *search; char *search;
asprintf(&search,"%s=",twstrim(key)); // asprintf(&search,"%s=",twstrim(key));
char *m_key = wstrim(strdup(key));
asprintf(&search,"%s=",m_key);
free(m_key);
for (uint i=0; i<lines().size(); i++) { for (uint i=0; i<lines().size(); i++) {
if (!found && strncmp(lines().at(i), search, strlen(search)) == 0) { if (!found && strncmp(lines().at(i), search, strlen(search)) == 0) {