diff --git a/PDB/src/CGALPDB/Chain.cpp b/PDB/src/CGALPDB/Chain.cpp index fb7582acb8b..132645ddc48 100644 --- a/PDB/src/CGALPDB/Chain.cpp +++ b/PDB/src/CGALPDB/Chain.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include CGAL_PDB_BEGIN_NAMESPACE //Residue dummy_residue; @@ -38,7 +38,7 @@ void Chain::write_pdb(std::ostream &out) const { char line[81]; - sprintf(line, "MODEL %8d ", 1); + std::sprintf(line, "MODEL %8d ", 1); out << line << std::endl; // int anum=1; @@ -71,7 +71,7 @@ int Chain::write(char chain, int start_index, std::ostream &out) const { } const char *terformat="TER %5d %3s %c %3d%c"; if (!residues_.empty()) { - sprintf(line, terformat, start_index, + std::sprintf(line, terformat, start_index, Monomer::type_string(last_type).c_str(), chain, last_resindex.index(),' '); out << line << std::endl; diff --git a/PDB/src/CGALPDB/Heterogen.cpp b/PDB/src/CGALPDB/Heterogen.cpp index ce42cf8ef95..7f2253e3592 100644 --- a/PDB/src/CGALPDB/Heterogen.cpp +++ b/PDB/src/CGALPDB/Heterogen.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include CGAL_PDB_BEGIN_NAMESPACE @@ -94,11 +94,11 @@ int Heterogen::write(std::string name, int num, //char chain=' '; //"HETATM%5d %4s %3s %4d %8.3f%8.3f%8.3f%6.2f%6.2f %4s%2s%2s"; - sprintf(line, CGAL_PDB_INTERNAL_NS::hetatom_line_oformat_, - start_index++, al.c_str(), - name.c_str(), num, - pt.x(), pt.y(), pt.z(), a.occupancy(), a.temperature_factor(), - a.element().c_str(), " "); + std::sprintf(line, CGAL_PDB_INTERNAL_NS::hetatom_line_oformat_, + start_index++, al.c_str(), + name.c_str(), num, + pt.x(), pt.y(), pt.z(), a.occupancy(), a.temperature_factor(), + a.element().c_str(), " "); out << line << std::endl; //++anum; } diff --git a/PDB/src/CGALPDB/PDB.cpp b/PDB/src/CGALPDB/PDB.cpp index e3a61e30c92..b4a23a13324 100644 --- a/PDB/src/CGALPDB/PDB.cpp +++ b/PDB/src/CGALPDB/PDB.cpp @@ -23,6 +23,8 @@ #include #include #include +#include + CGAL_PDB_BEGIN_NAMESPACE PDB::PDB(std::istream &in, bool print_errors) { @@ -63,9 +65,9 @@ void PDB::load(std::istream &in, bool print_errors){ header_.push_back(std::string(line)); int ti; char chain; - if (sscanf(line, "COMPND %d CHAIN: %c", &ti, &chain) == 2) { + if (std::sscanf(line, "COMPND %d CHAIN: %c", &ti, &chain) == 2) { names[chain]=last_name; - } else if (sscanf(line, "COMPND %d MOLECULE:", &ti) ==1) { + } else if (std::sscanf(line, "COMPND %d MOLECULE:", &ti) ==1) { int len= std::strlen(line); CGAL_assertion(line[len]=='\0'); --len; @@ -89,7 +91,7 @@ void PDB::load(std::istream &in, bool print_errors){ } else if (lt== CGAL_PDB_INTERNAL_NS::MODEL) { int mnum=0; char buf[81]; - sscanf(line, "%s %d", buf, &mnum); + std::sscanf(line, "%s %d", buf, &mnum); //new_model(Model_key(mnum), Model()); cur_model= Model_key(mnum); } else if ( lt== CGAL_PDB_INTERNAL_NS::HETATM