Index: src/builder.cpp
===================================================================
--- src/builder.cpp	(revision 451148c889a1e260d1c4a7372972a3c1e05c9c64)
+++ src/builder.cpp	(revision c750cc774f9938a4ce5ee5ed6083cd050554830e)
@@ -691,5 +691,5 @@
 void SaveConfig(char *ConfigFileName, config *configuration, periodentafel *periode, molecule *mol)
 {
-  char filename[255];
+  char filename[MAXSTRINGSIZE];
   ofstream output;
 
@@ -752,5 +752,5 @@
   ofstream output;
   string line;
-  char filename[255];
+  char filename[MAXSTRINGSIZE];
   char *ConfigFileName = NULL;
   char *ElementsFileName = NULL;
Index: src/config.cpp
===================================================================
--- src/config.cpp	(revision 451148c889a1e260d1c4a7372972a3c1e05c9c64)
+++ src/config.cpp	(revision c750cc774f9938a4ce5ee5ed6083cd050554830e)
@@ -13,9 +13,9 @@
 config::config()
 {
-  mainname = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
-  defaultpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
-  pseudopotpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
-  configpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
-  configname = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
+  mainname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
+  defaultpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
+  pseudopotpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
+  configpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
+  configname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
   strcpy(mainname,"pcp");
   strcpy(defaultpath,"not specified");
@@ -414,5 +414,5 @@
   char *ptr = NULL;
   int last = -1;
-  for(int i=0;i<255;i++) {
+  for(int i=0;i<MAXSTRINGSIZE;i++) {
     if (filename[i] == '/')
       last = i;
@@ -1168,5 +1168,6 @@
                 case(string_type):
                   if (value != NULL) {
-                    if (maxlength == -1) maxlength = strlen((char *)value); // get maximum size of string array
+                    //if (maxlength == -1) maxlength = strlen((char *)value); // get maximum size of string array
+                    maxlength = MAXSTRINGSIZE;
                     length = maxlength > (dummy-dummy1) ? (dummy-dummy1) : maxlength; // cap at maximum
                     strncpy((char *)value, dummy1, length);  // copy as much
Index: src/defs.hpp
===================================================================
--- src/defs.hpp	(revision 451148c889a1e260d1c4a7372972a3c1e05c9c64)
+++ src/defs.hpp	(revision c750cc774f9938a4ce5ee5ed6083cd050554830e)
@@ -37,4 +37,7 @@
 enum value_type { string_type, double_type, int_type, row_int, row_double, grid, lower_trigrid, upper_trigrid}; 
 
+// maximum length of any char array
+#define MAXSTRINGSIZE 255
+
 // various standard filenames
 #define DEFAULTCONFIG "main_pcp_linux"
Index: src/moleculelist.cpp
===================================================================
--- src/moleculelist.cpp	(revision 451148c889a1e260d1c4a7372972a3c1e05c9c64)
+++ src/moleculelist.cpp	(revision c750cc774f9938a4ce5ee5ed6083cd050554830e)
@@ -304,11 +304,11 @@
 {
   ofstream outputFragment;
-  char FragmentName[255];
-  char PathBackup[255];
+  char FragmentName[MAXSTRINGSIZE];
+  char PathBackup[MAXSTRINGSIZE];
   bool result = true;
   bool intermediateResult = true;
   atom *Walker = NULL;
   vector BoxDimension;
-  char TEFilename[255];
+  char TEFilename[MAXSTRINGSIZE];
   char *FragmentNumber;
   int FragmentCounter = 0;
Index: src/molecules.cpp
===================================================================
--- src/molecules.cpp	(revision 451148c889a1e260d1c4a7372972a3c1e05c9c64)
+++ src/molecules.cpp	(revision c750cc774f9938a4ce5ee5ed6083cd050554830e)
@@ -1892,5 +1892,5 @@
   ifstream KeySetFile;
   stringstream line;
-  char *filename = (char *) Malloc(sizeof(char)*255, "molecule::ParseKeySetFile - filename");
+  char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - filename");
   
   if (FragmentList != NULL) { // check list pointer
@@ -1905,8 +1905,8 @@
     // each line represents a new fragment
     int NumberOfFragments = 0;
-    char *buffer = (char *) Malloc(sizeof(char)*255, "molecule::ParseKeySetFile - *buffer");
+    char *buffer = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - *buffer");
     // 1. scan through file to know number of fragments
     while (!KeySetFile.eof()) {
-      KeySetFile.getline(buffer, 255);
+      KeySetFile.getline(buffer, MAXSTRINGSIZE);
       if (strlen(buffer) > 0) // there is at least on possible number on the parsed line
         NumberOfFragments++;
@@ -1919,5 +1919,5 @@
     NumberOfFragments = 0;
     while ((!KeySetFile.eof()) && (FragmentList->NumberOfMolecules > NumberOfFragments)) {
-      KeySetFile.getline(buffer, 255);
+      KeySetFile.getline(buffer, MAXSTRINGSIZE);
       KeySet CurrentSet;
       if ((strlen(buffer) > 0) && (ScanBufferIntoKeySet(out, buffer, CurrentSet)))  // if at least one valid atom was added, write config
@@ -1946,5 +1946,5 @@
   ofstream AdjacencyFile;
   atom *Walker = NULL;
-  char *filename = (char *) Malloc(sizeof(char)*255, "molecule::StoreAdjacencyToFile - filename");
+  char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::StoreAdjacencyToFile - filename");
   bool status = true;
 
@@ -1982,5 +1982,5 @@
 bool molecule::CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms, int bondorder)
 {
-  char *filename = (char *) Malloc(sizeof(char)*255, "molecule::CheckAdjacencyFileAgainstMolecule - filename");
+  char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::CheckAdjacencyFileAgainstMolecule - filename");
   ifstream File;
   bool status = true;
@@ -1996,5 +1996,5 @@
 
     // determine order from file
-    File.getline(filename, 255);    
+    File.getline(filename, MAXSTRINGSIZE);    
     if (bondorder != atoi(&filename[5])) {
       *out << "Bond order desired is " << bondorder << " and does not match one in file " << filename[6] << "." << endl;
@@ -2003,5 +2003,5 @@
       // Parse the file line by line and count the bonds
       while (!File.eof()) {
-        File.getline(filename, 255);
+        File.getline(filename, MAXSTRINGSIZE);
         stringstream line;
         line.str(filename);
Index: src/molecules.hpp
===================================================================
--- src/molecules.hpp	(revision 451148c889a1e260d1c4a7372972a3c1e05c9c64)
+++ src/molecules.hpp	(revision c750cc774f9938a4ce5ee5ed6083cd050554830e)
@@ -247,6 +247,6 @@
     element *start; //!< start of element list
     element *end;   //!< end of element list
-    char header1[255]; //!< store first header line
-    char header2[255]; //!< store second header line
+    char header1[MAXSTRINGSIZE]; //!< store first header line
+    char header2[MAXSTRINGSIZE]; //!< store second header line
   
   periodentafel();
Index: src/periodentafel.cpp
===================================================================
--- src/periodentafel.cpp	(revision 451148c889a1e260d1c4a7372972a3c1e05c9c64)
+++ src/periodentafel.cpp	(revision c750cc774f9938a4ce5ee5ed6083cd050554830e)
@@ -175,6 +175,6 @@
     infile.open(filename);
   if (infile != NULL) {
-    infile.getline(header1, 255);
-    infile.getline(header2, 255); // skip first two header lines
+    infile.getline(header1, MAXSTRINGSIZE);
+    infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines
     cout <<  "Parsed elements:";
     while (!infile.eof()) {
