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

Comparing trunk/src/openbabel/rotor.cpp (file contents):
Revision 819 by tim, Fri Dec 16 21:52:50 2005 UTC vs.
Revision 1081 by gezelter, Thu Oct 19 20:49:05 2006 UTC

# Line 2 | Line 2 | Copyright (C) 1998-2000 by OpenEye Scientific Software
2   rotor.cpp - Rotate dihedral angles according to rotor rules.
3  
4   Copyright (C) 1998-2000 by OpenEye Scientific Software, Inc.
5 < Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison
5 > Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison
6  
7   This file is part of the Open Babel project.
8   For more information, see <http://openbabel.sourceforge.net/>
# Line 870 | Line 870 | OBRotorRules::OBRotorRules()
870   {
871      _quiet=false;
872      _init = false;
873 <    STR_DEFINE(_dir, FRC_PATH);
873 >    STR_DEFINE(_dir, FRC_PATH );
874      _envvar = "FORCE_PARAM_PATH";
875      _filename = "torlib.txt";
876      _subdir = "data";
# Line 919 | Line 919 | void OBRotorRules::ParseLine(const char *buffer)
919  
920      if (!vs.empty() && vs.size() > 5)
921      {
922 <        strcpy(temp_buffer,vs[0].c_str());
922 >        strncpy(temp_buffer,vs[0].c_str(), sizeof(temp_buffer) - 1);
923 >        temp_buffer[sizeof(temp_buffer) - 1] = '\0';
924          //reference atoms
925          for (i = 0;i < 4;i++)
926              ref[i] = atoi(vs[i+1].c_str())-1;
# Line 1047 | Line 1048 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1048          char buffer[BUFF_SIZE];
1049          if (!_quiet)
1050          {
1051 <            sprintf(buffer,"%3d%3d%3d%3d %s",
1051 >            snprintf(buffer, BUFF_SIZE, "%3d%3d%3d%3d %s",
1052                      ref[0],ref[1],ref[2],ref[3],
1053                      ((*i)->GetSmartsString()).c_str());
1054              obErrorLog.ThrowError(__func__, buffer, obDebug);
# Line 1080 | Line 1081 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1081          if (!_quiet)
1082          {
1083              char buffer[BUFF_SIZE];
1084 <            sprintf(buffer,"%3d%3d%3d%3d %s",
1084 >            snprintf(buffer,BUFF_SIZE,"%3d%3d%3d%3d %s",
1085                      ref[0],ref[1],ref[2],ref[3],"sp3-sp3");
1086              obErrorLog.ThrowError(__func__, buffer, obDebug);
1087          }
# Line 1093 | Line 1094 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1094              if (!_quiet)
1095              {
1096                  char buffer[BUFF_SIZE];
1097 <                sprintf(buffer,"%3d%3d%3d%3d %s",
1097 >                snprintf(buffer,BUFF_SIZE,"%3d%3d%3d%3d %s",
1098                          ref[0],ref[1],ref[2],ref[3],"sp2-sp2");
1099                  obErrorLog.ThrowError(__func__, buffer, obDebug);
1100              }
# Line 1105 | Line 1106 | void OBRotorRules::GetRotorIncrements(OBMol &mol,OBBon
1106              if (!_quiet)
1107              {
1108                  char buffer[BUFF_SIZE];
1109 <                sprintf(buffer,"%3d%3d%3d%3d %s",
1109 >                snprintf(buffer,BUFF_SIZE,"%3d%3d%3d%3d %s",
1110                          ref[0],ref[1],ref[2],ref[3],"sp2-sp3");
1111                  obErrorLog.ThrowError(__func__, buffer, obDebug);
1112              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines