Skip to content
Snippets Groups Projects
Commit 07ebc575 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

fixed warnings by replacing strcat with string_format

parent 7cf4375c
No related branches found
No related tags found
No related merge requests found
......@@ -148,16 +148,12 @@ public:
streamIDs = std::vector<CdoStreamID>(neof);
for (eofID = 0; eofID < neof; eofID++)
{
oname[nchars] = '\0';
std::string file_name = MpMO::string_format("%s%5.5i%s", oname, eofID, filesuffix[0] ? filesuffix : "");
sprintf(eof_name, "%5.5i", eofID);
strcat(oname, eof_name);
if (filesuffix[0]) strcat(oname, filesuffix);
streamIDs[eofID] = cdo_open_write(oname);
streamIDs[eofID] = cdo_open_write(file_name);
if (Options::cdoVerbose)
cdo_print("opened %s ('w') as stream%i for %i. eof", oname, streamIDs[eofID]->get_id(), eofID + 1);
cdo_print("opened %s ('w') as stream%i for %i. eof", file_name, streamIDs[eofID]->get_id(), eofID + 1);
cdo_def_vlist(streamIDs[eofID], vlistID3);
}
......
......@@ -158,11 +158,13 @@ public:
{
oname[nchars] = '\0';
sprintf(eof_name, "%5.5i", eofID);
strcat(oname, eof_name);
if (filesuffix[0]) strcat(oname, filesuffix);
streamIDs[eofID] = cdo_open_write(oname);
//sprintf(eof_name, "%5.5i", eofID);
//strcat(oname, eof_name);
//if (filesuffix[0]) strcat(oname, filesuffix);
std::string file_name = MpMO::string_format("%s%5.5i%s", oname, eofID, filesuffix[0] ? filesuffix : "");
streamIDs[eofID] = cdo_open_write(file_name);
if (Options::cdoVerbose)
cdo_print("opened %s ('w') as stream%i for %i. eof", oname, streamIDs[eofID]->get_id(), eofID + 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment