more use of fmtlib and std::string

This commit is contained in:
Axel Kohlmeyer
2020-06-25 21:32:30 -04:00
parent 4816c5c7cc
commit e4a3a518f7
12 changed files with 94 additions and 162 deletions

View File

@ -848,16 +848,12 @@ bool Info::is_active(const char *category, const char *name)
if (!match && lmp->suffix_enable) {
if (lmp->suffix) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix);
if (strcmp(style,name_w_suffix) == 0) match = 1;
delete[] name_w_suffix;
std::string name_w_suffix = name + std::string("/") + lmp->suffix;
if (name_w_suffix == style) match = 1;
}
if (!match && lmp->suffix2) {
char *name_w_suffix = new char [len + 2 + strlen(lmp->suffix2)];
sprintf(name_w_suffix,"%s/%s",name,lmp->suffix2);
if (strcmp(style,name_w_suffix) == 0) match = 1;
delete[] name_w_suffix;
std::string name_w_suffix = name + std::string("/") + lmp->suffix2;
if (name_w_suffix == style) match = 1;
}
}
return match ? true : false;