--- trunk/OOPSE-2.0/src/UseTheForce/DUFF.cpp 2004/10/26 22:24:52 1650 +++ trunk/OOPSE-2.0/src/UseTheForce/DUFF.cpp 2004/10/27 00:01:29 1653 @@ -454,10 +454,8 @@ DUFF::DUFF(){ DUFF::DUFF(){ - char fileName[200]; - char* ffPath_env = "FORCE_PARAM_PATH"; - char* ffPath; - char temp[200]; + string fileName; + string tempString; headAtomType = NULL; currentAtomType = NULL; @@ -567,29 +565,21 @@ DUFF::DUFF(){ // generate the force file name - strcpy( fileName, "DUFF.frc" ); + fileName = "DUFF.frc"; // fprintf( stderr,"Trying to open %s\n", fileName ); // attempt to open the file in the current directory first. - frcFile = fopen( fileName, "r" ); + frcFile = fopen( fileName.c_str(), "r" ); if( frcFile == NULL ){ // next see if the force path enviorment variable is set - - ffPath = getenv( ffPath_env ); - if( ffPath == NULL ) { - STR_DEFINE(ffPath, FRC_PATH ); - } - - - strcpy( temp, ffPath ); - strcat( temp, "/" ); - strcat( temp, fileName ); - strcpy( fileName, temp ); - - frcFile = fopen( fileName, "r" ); + + tempString = ffPath + "/" + fileName; + fileName = tempString; + + frcFile = fopen( fileName.c_str(), "r" ); if( frcFile == NULL ){ @@ -598,7 +588,7 @@ DUFF::DUFF(){ "\t%s\n" "\tHave you tried setting the FORCE_PARAM_PATH environment " "variable?\n", - fileName ); + fileName.c_str() ); painCave.severity = OOPSE_ERROR; painCave.isFatal = 1; simError();