simplify using std::string and utils::strdup(); get rid of strtok()
This commit is contained in:
@ -47,20 +47,13 @@ void DumpAtom::init_style()
|
||||
// format = copy of default or user-specified line format
|
||||
// default depends on image flags
|
||||
|
||||
delete [] format;
|
||||
delete[] format;
|
||||
if (format_line_user) {
|
||||
int n = strlen(format_line_user) + 2;
|
||||
format = new char[n];
|
||||
strcpy(format,format_line_user);
|
||||
strcat(format,"\n");
|
||||
format = utils::strdup(std::string(format_line_user) + "\n");
|
||||
} else {
|
||||
char *str;
|
||||
if (image_flag == 0) str = (char *) TAGINT_FORMAT " %d %g %g %g";
|
||||
else str = (char *) TAGINT_FORMAT " %d %g %g %g %d %d %d";
|
||||
int n = strlen(str) + 2;
|
||||
format = new char[n];
|
||||
strcpy(format,str);
|
||||
strcat(format,"\n");
|
||||
if (image_flag == 0) format = utils::strdup(TAGINT_FORMAT " %d %g %g %g");
|
||||
else format = utils::strdup(TAGINT_FORMAT " %d %g %g %g %d %d %d");
|
||||
}
|
||||
|
||||
// setup boundary string
|
||||
|
||||
Reference in New Issue
Block a user