Index: pcp/src/output.c
===================================================================
--- pcp/src/output.c	(revision d52fb5c8aa0c112913f484ff4044660a6e6618f9)
+++ pcp/src/output.c	(revision d3482ae69a065785b1298aa09621c97f3d08d12f)
@@ -321,5 +321,5 @@
   fftw_complex *srcpsiC = (fftw_complex *)LevS->Dens->DensityCArray[TempDensity];
   FILE *SrcPsiData, *SrcPsiDoc;
-  char suffixdat[255], suffixdoc[255];
+  char *suffixdat, *suffixdoc;
   MPI_Status status;
   struct OnePsiElement *OnePsiA, *LOnePsiA;
@@ -327,6 +327,8 @@
   int Num = 0, colorNo = 0;
   int Sent = 0, sent = 0;
- 
+  
   SpeedMeasure(P,ReadnWriteTime,StartTimeDo);
+  suffixdat = (char *) Malloc(sizeof(char)*255, "OutputSrcPsiDensity: *suffixdat");
+  suffixdoc = (char *) Malloc(sizeof(char)*255, "OutputSrcPsiDensity: *suffixdoc");
   sprintf(suffixdat, ".%.254s.L%i", P->R.MinimisationName[type], LevS->LevelNo);
   strncpy (suffixdoc, suffixdat, 255);
@@ -372,4 +374,6 @@
   	fclose(SrcPsiDoc);
   }
+  Free(suffixdat, "OutputSrcPsiDensity: *suffixdat");
+  Free(suffixdoc, "OutputSrcPsiDensity: *suffixdoc");
   
   // send/receive around and write share of coefficient array of each wave function 
@@ -1037,5 +1041,5 @@
   float step = P->Files.OutVisStep[P->Lat.Lev[STANDARTLEVEL].LevelNo];
   int No=0, destpos;
-  char suffix[255];
+  char *suffix;
   FILE *DensityData, *DensityPos;
   int Nx = Lev0->Plan0.plan->N[0]+1;
@@ -1045,5 +1049,7 @@
   N[1] = Lev0->Plan0.plan->N[1]+1;
   N[2] = Lev0->Plan0.plan->N[2]+1;
+
   // Open respective file depending on RiemannTensor use
+  suffix = (char *) Malloc(sizeof(char)*255, "CombineOutVisDensity: *suffix");
   switch (Lat->RT.ActualUse) {
   case active:
@@ -1146,4 +1152,5 @@
     break;
   }
+  Free(suffix, "CombineOutVisDensity: *suffix");
 }
 
@@ -1310,5 +1317,5 @@
   int is,ia,i;
   FILE *SrcIonDoc, *SrcIonData;
-  char suffix[255];
+  char *suffix = (char *) Malloc(sizeof(char)*255, "CombineOutVisDensity: *suffix");
 
   if (!(P->Par.me == 0)) return;
@@ -1337,4 +1344,5 @@
   }
   fclose(SrcIonData);
+  Free(suffix, "CombineOutVisDensity: *suffix");
 }
 
@@ -1479,8 +1487,11 @@
   float data[6];      // holds temporarily twice NDIM values as write buffer
   int Z;
-  char *datnamef, *datnameZ, *posname, suffix[255];
+  char *datnamef, *datnameZ, *posname, *suffix;
   FILE *IonsDataF, *IonsDataZ, *IonsPos, *IonsDoc, *IonsDx;
+
   if (!P->Files.MeOutVis && P->Par.me == 0) return;
+
   // generate file names
+  suffix = (char *) Malloc(sizeof(char)*255, "OutVisIons: * suffix");
   datnamef = (char*)
     malloc(strlen(P->Files.mainname)+strlen(suffixionfor) + 1);
@@ -1576,4 +1587,5 @@
     fclose(IonsDataF);
   }
+  Free(suffix, "OutVisIons: *suffix");
 }
 
@@ -1757,26 +1769,25 @@
   struct LatticeLevel *Lev0 = R->Lev0;
   const int myPE = P->Par.me_comm_ST_Psi;
-  char filename[255], spin[12];
+  char *filename, spin[12];
   char *suchpointer;
   FILE *PlotFile = NULL;
   time_t seconds; 
   
-
-  // open file
   time(&seconds); // get current time
 
+  filename = (char *) Malloc(sizeof(char)*255, "PlotSrcPlane: *filename");
   switch (Lat->Psi.PsiST) {
-  case SpinDouble:    
-    sprintf(&filename[0], ".psi%i_cut%i.csv", wavenr, index);
-    strncat(spin,"SpinDouble",12);
-    break;
-  case SpinUp:
-    sprintf(&filename[0], ".psi%i_cut%i_up.csv", wavenr, index);
-    strncat(spin,"SpinUp",12);
-    break;
-  case SpinDown:
-    sprintf(&filename[0], ".psi%i_cut%i_down.csv", wavenr, index);
-    strncat(spin,"SpinDown",12);
-    break;
+    case SpinDouble:    
+      sprintf(&filename[0], ".psi%i_cut%i.csv", wavenr, index);
+      strncat(spin,"SpinDouble",12);
+      break;
+    case SpinUp:
+      sprintf(&filename[0], ".psi%i_cut%i_up.csv", wavenr, index);
+      strncat(spin,"SpinUp",12);
+      break;
+    case SpinDown:
+      sprintf(&filename[0], ".psi%i_cut%i_down.csv", wavenr, index);
+      strncat(spin,"SpinDown",12);
+      break;
   }
   
@@ -1792,5 +1803,6 @@
     } else { Error(SomeError, "PlotSrcPlane: Opening Plot File"); }
   }
-    
+  Free(filename, "PlotSrcPlane: *filename");
+  
   // plot density
   PlotRealDensity(P, Lev0, PlotFile, index, node, density, density);
Index: pcp/src/perturbed.c
===================================================================
--- pcp/src/perturbed.c	(revision d52fb5c8aa0c112913f484ff4044660a6e6618f9)
+++ pcp/src/perturbed.c	(revision d3482ae69a065785b1298aa09621c97f3d08d12f)
@@ -2894,4 +2894,7 @@
   double eta, delta_chi, S, A, iso;
   int cross_lookup[4];
+  char *suffixchi;
+  FILE *ChiFile;
+  time_t seconds;
 
   if(P->Call.out[NormalOut]) fprintf(stderr,"(%i)Calculating Magnetic Susceptibility \n", P->Par.me);  
@@ -2950,4 +2953,6 @@
     }
   }
+
+  suffixchi = (char *) Malloc(sizeof(char)*255, "CalculateMagneticSusceptibility: *suffixchi");
   // store symmetrized matrix
   for (in=0;in<NDIM;in++)
@@ -2956,8 +2961,4 @@
   // output tensor to file
   if (P->Par.me == 0) {
-    FILE *ChiFile;
-    char suffixchi[255];
-    time_t seconds;
-      
     time(&seconds); // get current time
     sprintf(&suffixchi[0], ".chi.L%i.csv", Lev0->LevelNo);
@@ -3004,8 +3005,4 @@
   // output PAS tensor to file
   if (P->Par.me == 0) {
-    FILE *ChiFile;
-    char suffixchi[255];
-    time_t seconds;
-      
     time(&seconds); // get current time
     sprintf(&suffixchi[0], ".chi_PAS.csv");
@@ -3026,4 +3023,5 @@
   gsl_vector_free(eval);
   gsl_matrix_complex_free(H);
+  Free(suffixchi, "CalculateMagneticSusceptibility: *suffixchi");
 }
 
@@ -3069,5 +3067,5 @@
   gsl_matrix_complex *H = gsl_matrix_complex_calloc(NDIM,NDIM);
   FILE *SigmaFile;
-  char suffixsigma[255];
+  char *suffixsigma = (char *) Malloc(sizeof(char)*255, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma");
   
   time_t seconds;  
@@ -3160,5 +3158,5 @@
   // output tensor to file
   if (P->Par.me == 0) {
-    sprintf(&suffixsigma[0], ".sigma_chi_rezi.L%i.csv", Lev0->LevelNo);
+    sprintf(suffixsigma, ".sigma_chi_rezi.L%i.csv", Lev0->LevelNo);
     OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]);
     fprintf(SigmaFile,"# chemical shielding tensor sigma_rezi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
@@ -3186,5 +3184,5 @@
       // output tensor to file
       if (P->Par.me == 0) {
-        sprintf(&suffixsigma[0], ".sigma_i%i_%s_rezi.L%i.csv", ion, I->I[it].Symbol, Lev0->LevelNo);
+        sprintf(suffixsigma, ".sigma_i%i_%s_rezi.L%i.csv", ion, I->I[it].Symbol, Lev0->LevelNo);
         OpenFile(P, &SigmaFile, suffixsigma, "a", P->Call.out[ReadOut]);
         fprintf(SigmaFile,"# chemical shielding tensor sigma_rezi[01,02,03,10,11,12,20,21,22], seed %i, config %s, run on %s", R->Seed, P->Files.default_path, ctime(&seconds));
@@ -3232,7 +3230,5 @@
       }
       if (P->Par.me == 0) {
-        FILE *SigmaFile;
-        char suffixsigma[255];
-        sprintf(&suffixsigma[0], ".sigma_i%i_%s_PAS.csv", ion, I->I[it].Symbol);
+        sprintf(suffixsigma, ".sigma_i%i_%s_PAS.csv", ion, I->I[it].Symbol);
         if (Lev0->LevelNo == Lat->MaxLevel-2) {
           OpenFile(P, &SigmaFile, suffixsigma, "w", P->Call.out[ReadOut]);
@@ -3304,4 +3300,5 @@
   gsl_vector_free(eval);
   gsl_matrix_complex_free(H);
+  Free(suffixsigma, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma");
 }
 
@@ -3337,5 +3334,5 @@
   const int N0 = Lev0->Plan0.plan->local_nx;
   FILE *MomentFile;
-  char suffixmoment[255];
+  char *suffixmoment = (char *) Malloc(sizeof(char)*255, "CalculateMagneticMoment: *suffixmoment");
   time_t seconds;  
   time(&seconds); // get current time
@@ -3444,4 +3441,5 @@
 
   gsl_matrix_complex_free(H);
+  Free(suffixmoment, "CalculateMagneticMoment: *suffixmoment");
 }
 
@@ -3776,5 +3774,5 @@
   struct LatticeLevel *Lev0 = R->Lev0;
   struct Density *Dens0 = Lev0->Dens;
-  char filename[255];
+  char *filename;
   char *suchpointer;
   FILE *PlotFile = NULL;
@@ -3795,4 +3793,5 @@
   if (!myPE) { // only process 0 writes to file
     // open file
+    filename = (char *) Malloc(sizeof(char)*255, "PlotVectorPlane: *filename");
     sprintf(&filename[0], ".current.L%i.csv", Lev0->LevelNo);
     OpenFile(P, &PlotFile, filename, "w", P->Call.out[ReadOut]);
@@ -3805,4 +3804,5 @@
       fprintf(PlotFile,"\n");
     } else { Error(SomeError, "PlotVectorPlane: Opening Plot File"); }
+    Free(filename, "PlotVectorPlane: *filename");
   }
 
Index: pcp/src/pseudo.c
===================================================================
--- pcp/src/pseudo.c	(revision d52fb5c8aa0c112913f484ff4044660a6e6618f9)
+++ pcp/src/pseudo.c	(revision d3482ae69a065785b1298aa09621c97f3d08d12f)
@@ -445,5 +445,5 @@
 void InitPseudoRead(struct Problem *P, char *pseudopot_path) 
 {
-  char cpiInputFileName[255];
+  char *cpiInputFileName;
   FILE *cpiInputFile;
   int i,it,ib,il,m,j,ia;
@@ -483,4 +483,5 @@
   PP->lm_endmax = 0;
   PP->corecorr = NotCoreCorrected;
+  cpiInputFileName = (char *) Malloc(sizeof(char)*255, "InitPseudoRead: *cpiInputFileName");
   for (it = 0; it < I->Max_Types; it++) {
     PP->lm_end[it] = I->I[it].l_max*I->I[it].l_max+1-2*I->I[it].l_loc;
@@ -585,4 +586,5 @@
     fclose(cpiInputFile);
   }
+  Free(cpiInputFileName, "InitPseudoRead: *cpiInputFileName");
   PP->fnl = (fftw_complex ****) Malloc(sizeof(fftw_complex***)*(Lat->Psi.LocalNo+1), "InitPseudoRead: ");
   for (i=0; i< Lat->Psi.LocalNo+1; i++) {
Index: pcp/src/wannier.c
===================================================================
--- pcp/src/wannier.c	(revision d52fb5c8aa0c112913f484ff4044660a6e6618f9)
+++ pcp/src/wannier.c	(revision d3482ae69a065785b1298aa09621c97f3d08d12f)
@@ -1855,5 +1855,5 @@
   int i,l,j, msglen;
   FILE *SpreadFile;
-  char tagname[255];
+  char *tagname;
   char suffix[18];
   double WannierCentre[NDIM+1]; // combined centre and spread
@@ -1874,5 +1874,6 @@
   if (P->Call.out[NormalOut]) fprintf(stderr,"(%i) Parsing Wannier Centres from file ... \n", P->Par.me);
   
-  if (P->Par.me_comm_ST == 0) { 
+  if (P->Par.me_comm_ST == 0) {
+    tagname = (char *) Malloc(sizeof(char)*255, "ParseWannierFile: *tagname");
     if(!OpenFile(P, &SpreadFile, suffix, "r", P->Call.out[ReadOut])) { // check if file exists
       if (MPI_Bcast(&signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)
@@ -1936,5 +1937,5 @@
         for (j=0;j<NDIM;j++) Psi->AddData[OnePsiA->MyLocalNo].WannierCentre[j] = WannierCentre[j];
         Psi->AddData[OnePsiA->MyLocalNo].WannierSpread = WannierCentre[NDIM];
-        //if (P->Par.me ==0 && P->Call.out[ValueOut]) fprintf(stderr,"(%i) %s\t%lg\t%lg\t%lg\t\t%lg\n",P->Par.me, tagname,Psi->AddData[OnePsiA->MyLocalNo].WannierCentre[0],Psi->AddData[OnePsiA->MyLocalNo].WannierCentre[1],Psi->AddData[OnePsiA->MyLocalNo].WannierCentre[2],Psi->AddData[OnePsiA->MyLocalNo].WannierSpread);
+        //if (P->Par.me == 0 && P->Call.out[ValueOut]) fprintf(stderr,"(%i) %s\t%lg\t%lg\t%lg\t\t%lg\n",P->Par.me, tagname,Psi->AddData[OnePsiA->MyLocalNo].WannierCentre[0],Psi->AddData[OnePsiA->MyLocalNo].WannierCentre[1],Psi->AddData[OnePsiA->MyLocalNo].WannierCentre[2],Psi->AddData[OnePsiA->MyLocalNo].WannierSpread);
       } else if (P->Par.me_comm_ST == 0) { // if they are not local, yet we are process 0, send 'em to leader of its Psi group
         if (MPI_Send(WannierCentre, NDIM+1, MPI_DOUBLE, OnePsiA->my_color_comm_ST_Psi, ParseWannierTag, P->Par.comm_ST_PsiT) != MPI_SUCCESS)
@@ -1944,6 +1945,8 @@
     }
   }
-  if ((SpreadFile != NULL) && (P->Par.me_comm_ST == 0)) 
+  if ((SpreadFile != NULL) && (P->Par.me_comm_ST == 0)) { 
     fclose(SpreadFile);
+    Free(tagname, "ParseWannierFile: *tagname");
+  }
   //fprintf(stderr,"(%i) Parsing Wannier files succeeded!\n", P->Par.me);
   return 1;
