ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/openbabel/tinkerformat.cpp
(Generate patch)

Comparing trunk/src/openbabel/tinkerformat.cpp (file contents):
Revision 741 by tim, Wed Nov 16 19:42:11 2005 UTC vs.
Revision 1081 by gezelter, Thu Oct 19 20:49:05 2006 UTC

# Line 65 | Line 65 | class TinkerFormat : public OBFormat (public)
65          std::string auditMsg = "OpenBabel::Write molecule ";
66          std::string description(Description());
67          auditMsg += description.substr( 0, description.find('\n') );
68 <        obErrorLog.ThrowError(__FUNCTION__,
68 >        obErrorLog.ThrowError(__func__,
69                                auditMsg,
70                                obAuditMsg);
71  
# Line 95 | Line 95 | bool TinkerFormat::WriteMolecule(OBBase* pOb, OBConver
95      OBBond *bond;
96      vector<OBEdgeBase*>::iterator j;
97  
98 <    sprintf(buffer,"%6d %-20s   MM2 parameters",mol.NumAtoms(),mol.GetTitle());
99 <    ofs << buffer << endl;
98 >    snprintf(buffer, BUFF_SIZE, "%6d %-20s   MM2 parameters\n",mol.NumAtoms(),mol.GetTitle());
99 >    ofs << buffer;
100  
101      ttab.SetFromType("INT");
102  
# Line 108 | Line 108 | bool TinkerFormat::WriteMolecule(OBBase* pOb, OBConver
108          str = atom->GetType();
109          ttab.SetToType("MM2");
110          ttab.Translate(str1,str);
111 <        sprintf(buffer,"%6d %2s  %12.6f%12.6f%12.6f %5d",
111 >        snprintf(buffer, BUFF_SIZE, "%6d %2s  %12.6f%12.6f%12.6f %5d",
112                  i,
113                  etab.GetSymbol(atom->GetAtomicNum()),
114                  atom->GetX(),
# Line 119 | Line 119 | bool TinkerFormat::WriteMolecule(OBBase* pOb, OBConver
119  
120          for (bond = atom->BeginBond(j); bond; bond = atom->NextBond(j))
121          {
122 <            sprintf(buffer,"%6d", (bond->GetNbrAtom(atom))->GetIdx());
122 >            snprintf(buffer, BUFF_SIZE, "%6d", (bond->GetNbrAtom(atom))->GetIdx());
123              ofs << buffer;
124          }
125  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines