Changeset c510a7


Ignore:
Timestamp:
Apr 29, 2008, 12:19:51 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
e936b3
Parents:
307fd1
Message:

char lengths of 255 and MAXDUMMYSTRING replaced with define MAXSTRINGSIZE in molecuilder and pcp

Files:
16 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r307fd1 rc510a7  
    691691void SaveConfig(char *ConfigFileName, config *configuration, periodentafel *periode, molecule *mol)
    692692{
    693   char filename[255];
     693  char filename[MAXSTRINGSIZE];
    694694  ofstream output;
    695695
     
    752752  ofstream output;
    753753  string line;
    754   char filename[255];
     754  char filename[MAXSTRINGSIZE];
    755755  char *ConfigFileName = NULL;
    756756  char *ElementsFileName = NULL;
  • molecuilder/src/config.cpp

    r307fd1 rc510a7  
    1313config::config()
    1414{
    15   mainname = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
    16   defaultpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
    17   pseudopotpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
    18   configpath = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
    19   configname = (char *) MallocString(sizeof(char)*255,"config constructor: mainname");
     15  mainname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
     16  defaultpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
     17  pseudopotpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
     18  configpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
     19  configname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname");
    2020  strcpy(mainname,"pcp");
    2121  strcpy(defaultpath,"not specified");
     
    414414  char *ptr = NULL;
    415415  int last = -1;
    416   for(int i=0;i<255;i++) {
     416  for(int i=0;i<MAXSTRINGSIZE;i++) {
    417417    if (filename[i] == '/')
    418418      last = i;
     
    11681168                case(string_type):
    11691169                  if (value != NULL) {
    1170                     if (maxlength == -1) maxlength = strlen((char *)value); // get maximum size of string array
     1170                    //if (maxlength == -1) maxlength = strlen((char *)value); // get maximum size of string array
     1171                    maxlength = MAXSTRINGSIZE;
    11711172                    length = maxlength > (dummy-dummy1) ? (dummy-dummy1) : maxlength; // cap at maximum
    11721173                    strncpy((char *)value, dummy1, length);  // copy as much
  • molecuilder/src/defs.hpp

    r307fd1 rc510a7  
    3737enum value_type { string_type, double_type, int_type, row_int, row_double, grid, lower_trigrid, upper_trigrid};
    3838
     39// maximum length of any char array
     40#define MAXSTRINGSIZE 255
     41
    3942// various standard filenames
    4043#define DEFAULTCONFIG "main_pcp_linux"
  • molecuilder/src/moleculelist.cpp

    r307fd1 rc510a7  
    304304{
    305305  ofstream outputFragment;
    306   char FragmentName[255];
    307   char PathBackup[255];
     306  char FragmentName[MAXSTRINGSIZE];
     307  char PathBackup[MAXSTRINGSIZE];
    308308  bool result = true;
    309309  bool intermediateResult = true;
    310310  atom *Walker = NULL;
    311311  vector BoxDimension;
    312   char TEFilename[255];
     312  char TEFilename[MAXSTRINGSIZE];
    313313  char *FragmentNumber;
    314314  int FragmentCounter = 0;
  • molecuilder/src/molecules.cpp

    r307fd1 rc510a7  
    18921892  ifstream KeySetFile;
    18931893  stringstream line;
    1894   char *filename = (char *) Malloc(sizeof(char)*255, "molecule::ParseKeySetFile - filename");
     1894  char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - filename");
    18951895 
    18961896  if (FragmentList != NULL) { // check list pointer
     
    19051905    // each line represents a new fragment
    19061906    int NumberOfFragments = 0;
    1907     char *buffer = (char *) Malloc(sizeof(char)*255, "molecule::ParseKeySetFile - *buffer");
     1907    char *buffer = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - *buffer");
    19081908    // 1. scan through file to know number of fragments
    19091909    while (!KeySetFile.eof()) {
    1910       KeySetFile.getline(buffer, 255);
     1910      KeySetFile.getline(buffer, MAXSTRINGSIZE);
    19111911      if (strlen(buffer) > 0) // there is at least on possible number on the parsed line
    19121912        NumberOfFragments++;
     
    19191919    NumberOfFragments = 0;
    19201920    while ((!KeySetFile.eof()) && (FragmentList->NumberOfMolecules > NumberOfFragments)) {
    1921       KeySetFile.getline(buffer, 255);
     1921      KeySetFile.getline(buffer, MAXSTRINGSIZE);
    19221922      KeySet CurrentSet;
    19231923      if ((strlen(buffer) > 0) && (ScanBufferIntoKeySet(out, buffer, CurrentSet)))  // if at least one valid atom was added, write config
     
    19461946  ofstream AdjacencyFile;
    19471947  atom *Walker = NULL;
    1948   char *filename = (char *) Malloc(sizeof(char)*255, "molecule::StoreAdjacencyToFile - filename");
     1948  char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::StoreAdjacencyToFile - filename");
    19491949  bool status = true;
    19501950
     
    19821982bool molecule::CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms, int bondorder)
    19831983{
    1984   char *filename = (char *) Malloc(sizeof(char)*255, "molecule::CheckAdjacencyFileAgainstMolecule - filename");
     1984  char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::CheckAdjacencyFileAgainstMolecule - filename");
    19851985  ifstream File;
    19861986  bool status = true;
     
    19961996
    19971997    // determine order from file
    1998     File.getline(filename, 255);   
     1998    File.getline(filename, MAXSTRINGSIZE);   
    19991999    if (bondorder != atoi(&filename[5])) {
    20002000      *out << "Bond order desired is " << bondorder << " and does not match one in file " << filename[6] << "." << endl;
     
    20032003      // Parse the file line by line and count the bonds
    20042004      while (!File.eof()) {
    2005         File.getline(filename, 255);
     2005        File.getline(filename, MAXSTRINGSIZE);
    20062006        stringstream line;
    20072007        line.str(filename);
  • molecuilder/src/molecules.hpp

    r307fd1 rc510a7  
    247247    element *start; //!< start of element list
    248248    element *end;   //!< end of element list
    249     char header1[255]; //!< store first header line
    250     char header2[255]; //!< store second header line
     249    char header1[MAXSTRINGSIZE]; //!< store first header line
     250    char header2[MAXSTRINGSIZE]; //!< store second header line
    251251 
    252252  periodentafel();
  • molecuilder/src/periodentafel.cpp

    r307fd1 rc510a7  
    175175    infile.open(filename);
    176176  if (infile != NULL) {
    177     infile.getline(header1, 255);
    178     infile.getline(header2, 255); // skip first two header lines
     177    infile.getline(header1, MAXSTRINGSIZE);
     178    infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines
    179179    cout <<  "Parsed elements:";
    180180    while (!infile.eof()) {
  • pcp/src/defs.h

    r307fd1 rc510a7  
    2727#define NDIM_NDIM (NDIM*NDIM)           //!< spatial squared
    2828
    29 #define MAXDUMMYSTRING (199)    //!< maximum length when mallocting space for string
     29
     30#define MAXSTRINGSIZE (255)     //!< maximum length when mallocting space for string
    3031
    3132//#define mu0 6.691762496807159e-04 //!< permeability of the vacuum in atomic units (a_0 m_e e^{-2}, converted from CODATA values)
  • pcp/src/helpers.c

    r307fd1 rc510a7  
    9292void* Malloci(size_t size, const char* output, int i)
    9393{
    94   char dummyoutput[MAXDUMMYSTRING];
     94  char dummyoutput[MAXSTRINGSIZE];
    9595  void* dummy = (void *) malloc(size);
    9696  if (!dummy) {
     
    110110void* Mallocii(size_t size, const char* output, int i, int j)
    111111{
    112   char dummyoutput[MAXDUMMYSTRING];
     112  char dummyoutput[MAXSTRINGSIZE];
    113113  void* dummy = (void *) malloc(size);
    114114  if (!dummy) {
     
    142142void* Realloci(void* pointer, size_t size, const char* output, int i)
    143143{
    144   char dummyoutput[MAXDUMMYSTRING];
     144  char dummyoutput[MAXSTRINGSIZE];
    145145  void *dummy = (void *) realloc(pointer, size);
    146146  if (!dummy) {
     
    161161void* Reallocii(void* pointer, size_t size, const char* output, int i, int j)
    162162{
    163   char dummyoutput[MAXDUMMYSTRING];
     163  char dummyoutput[MAXSTRINGSIZE];
    164164  void *dummy = (void *) realloc(pointer, size);
    165165  if (!dummy) {
     
    234234  int info;
    235235  char processor_name[MPI_MAX_PROCESSOR_NAME];
    236   char dummy[MAXDUMMYSTRING];
     236  char dummy[MAXSTRINGSIZE];
    237237  P->Par.procs = P->Par.proc[PEPsi]*P->Par.proc[PEGamma];
    238238  P->Par.me = -1; /* eigene Position noch unklar */
  • pcp/src/init.c

    r307fd1 rc510a7  
    11761176  struct LatticeLevel *LevS = R->LevS;
    11771177  MPI_Comm_rank(P->Par.comm_ST_Psi, &myPE);  // Determines the rank of the calling process in the communicator
    1178   //char name[255];
     1178  //char name[MAXSTRINGSIZE];
    11791179  //sprintf(name, ".Psis-%i.all", myPE);
    11801180  //FILE *psi;
     
    15331533  /* Namen einlesen */
    15341534
    1535   P->Files.filename = MallocString(MAXDUMMYSTRING,"ReadParameters: filename");
     1535  P->Files.filename = MallocString(MAXSTRINGSIZE,"ReadParameters: filename");
    15361536        ParseForParameter(P->Call.out[ReadOut],file, "mainname", 0, 1, 1, string_type, P->Files.filename, 1, critical);
    15371537  //debug(P,"mainname");
    15381538  CreateMainname(P, filename);
    1539   P->Files.default_path = MallocString(MAXDUMMYSTRING,"ReadParameters: default_path");
     1539  P->Files.default_path = MallocString(MAXSTRINGSIZE,"ReadParameters: default_path");
    15401540  ParseForParameter(P->Call.out[ReadOut],file, "defaultpath", 0, 1, 1, string_type, P->Files.default_path, 1, critical);
    1541   P->Files.pseudopot_path = MallocString(MAXDUMMYSTRING,"ReadParameters: pseudopot_path");
     1541  P->Files.pseudopot_path = MallocString(MAXSTRINGSIZE,"ReadParameters: pseudopot_path");
    15421542  ParseForParameter(P->Call.out[ReadOut],file, "pseudopotpath", 0, 1, 1, string_type, P->Files.pseudopot_path, 1, critical);
    15431543  ParseForParameter(P->Call.out[ReadOut],file,"ProcPEGamma", 0, 1, 1, int_type, &(P->Par.proc[PEGamma]), 1, critical);
  • pcp/src/ions.c

    r307fd1 rc510a7  
    293293  I->TotalMass = 0;
    294294  char *free_name, *name;
    295   name = free_name = Malloc(255*sizeof(char),"IonsInitRead: Name");
     295  name = free_name = Malloc(MAXSTRINGSIZE*sizeof(char),"IonsInitRead: Name");
    296296  for (i=0; i < I->Max_Types; i++) {
    297297        sprintf(name,"Ion_Type%i",i+1);
    298298    I->I[i].corecorr = NotCoreCorrected;
    299     I->I[i].Name = MallocString(255, "IonsInitRead: Name");
    300     I->I[i].Symbol = MallocString(255, "IonsInitRead: Symbol");
     299    I->I[i].Name = MallocString(MAXSTRINGSIZE, "IonsInitRead: Name");
     300    I->I[i].Symbol = MallocString(MAXSTRINGSIZE, "IonsInitRead: Symbol");
    301301                ParseForParameter(P->Call.out[ReadOut],source, name, 0, 1, 1, int_type, &I->I[i].Max_IonsOfType, 1, critical);
    302302                ParseForParameter(P->Call.out[ReadOut],source, name, 0, 2, 1, int_type, &I->I[i].Z, 1, critical);
     
    10141014  //struct RunStruct *R = &P->R;
    10151015  struct Ions *I = &P->Ion;
    1016   char filename[255];
     1016  char filename[MAXSTRINGSIZE];
    10171017  FILE *output;
    10181018  int is, ia, nr = 0;
  • pcp/src/opt.c

    r307fd1 rc510a7  
    182182 */
    183183static int Start_ddd(char *Host, char *program, pid_t pid) {
    184   char s[MAXDUMMYSTRING];
     184  char s[MAXSTRINGSIZE];
    185185  if (Host) sprintf(s, "ddd -display %s %s %ld &", Host, program, (long int)pid);
    186186  else sprintf(s, "ddd %s %ld &", program, (long int)pid);
     
    196196 */
    197197static int Start_gdb(char *Host, char *program, pid_t pid) {
    198   char s[MAXDUMMYSTRING];
     198  char s[MAXSTRINGSIZE];
    199199  if (Host) sprintf(s, "xterm -display %s -e gdb %s %ld &", Host, program, (long int)pid);
    200200  else sprintf(s, "xterm -e gdb %s %ld &", program, (long int)pid);
     
    210210 */
    211211static int Start_dbx(char *Host, char *program, pid_t pid) {
    212   char s[MAXDUMMYSTRING];
     212  char s[MAXSTRINGSIZE];
    213213  program = program;
    214214  if (Host) sprintf(s, "xterm -display %s -e dbx -p %ld &", Host, (long int)pid);
     
    225225 */
    226226static int Start_cvd(char *Host, char *program, pid_t pid) {
    227   char s[MAXDUMMYSTRING];
     227  char s[MAXSTRINGSIZE];
    228228  program = program;
    229229  if (Host) sprintf(s, "cvd -pid %ld -display %s &", (long int)pid, Host);
     
    240240 */
    241241static int Start_totalview(char *Host, char *program, pid_t pid) {
    242   char s[MAXDUMMYSTRING];
     242  char s[MAXSTRINGSIZE];
    243243  int myrank = 0;
    244244  MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
     
    257257 */
    258258static int Start_ups(char *Host, char *program, pid_t pid) {
    259   char s[MAXDUMMYSTRING];
     259  char s[MAXSTRINGSIZE];
    260260  if (Host) sprintf(s, "ups -display %s %s %ld &", Host, program, (long int)pid);
    261261  else sprintf(s, "ups %s %ld &", program, (long int)pid);
     
    271271 */
    272272void StartDebugger(void) {
    273   char Host[MAXDUMMYSTRING] = "", Debugger[MAXDUMMYSTRING] = "";
     273  char Host[MAXSTRINGSIZE] = "", Debugger[MAXSTRINGSIZE] = "";
    274274  char *host_ptr = Host;
    275275  int (*Debugger_call) (char *, char *, pid_t);
  • pcp/src/output.c

    r307fd1 rc510a7  
    329329 
    330330  SpeedMeasure(P,ReadnWriteTime,StartTimeDo);
    331   suffixdat = (char *) Malloc(sizeof(char)*255, "OutputSrcPsiDensity: *suffixdat");
    332   suffixdoc = (char *) Malloc(sizeof(char)*255, "OutputSrcPsiDensity: *suffixdoc");
     331  suffixdat = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "OutputSrcPsiDensity: *suffixdat");
     332  suffixdoc = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "OutputSrcPsiDensity: *suffixdoc");
    333333  sprintf(suffixdat, ".%.254s.L%i", P->R.MinimisationName[type], LevS->LevelNo);
    334   strncpy (suffixdoc, suffixdat, 255);
     334  strncpy (suffixdoc, suffixdat, MAXSTRINGSIZE);
    335335  // for the various spin cases, output the doc-file if it's process 0
    336336  if (P->Par.me_comm_ST == 0) { // if we are process 0 of SpinDouble or SpinUp&-Down
     
    338338    case SpinDouble:
    339339      colorNo = 0;
    340       strncat (suffixdat, suffixsrcpsidat, 255-strlen(suffixdat));
    341       strncat (suffixdoc, suffixsrcpsidoc, 255-strlen(suffixdoc));
     340      strncat (suffixdat, suffixsrcpsidat, MAXSTRINGSIZE-strlen(suffixdat));
     341      strncat (suffixdoc, suffixsrcpsidoc, MAXSTRINGSIZE-strlen(suffixdoc));
    342342      Num =  Lat->Psi.GlobalNo[PsiMaxNoDouble];
    343343      break;
    344344    case SpinUp:
    345345      colorNo = 0;
    346       strncat (suffixdat, suffixsrcpsiupdat, 255-strlen(suffixdat));
    347       strncat (suffixdoc, suffixsrcpsiupdoc, 255-strlen(suffixdoc));
     346      strncat (suffixdat, suffixsrcpsiupdat, MAXSTRINGSIZE-strlen(suffixdat));
     347      strncat (suffixdoc, suffixsrcpsiupdoc, MAXSTRINGSIZE-strlen(suffixdoc));
    348348      Num = Lat->Psi.GlobalNo[PsiMaxNoUp];
    349349      break;
    350350    case SpinDown:
    351351      colorNo = 1;
    352       strncat (suffixdat, suffixsrcpsidowndat, 255-strlen(suffixdat));
    353       strncat (suffixdoc, suffixsrcpsidowndoc, 255-strlen(suffixdoc));
     352      strncat (suffixdat, suffixsrcpsidowndat, MAXSTRINGSIZE-strlen(suffixdat));
     353      strncat (suffixdoc, suffixsrcpsidowndoc, MAXSTRINGSIZE-strlen(suffixdoc));
    354354      Num =  Lat->Psi.GlobalNo[PsiMaxNoDown];
    355355      break;
     
    571571  int LevelNo, readnr=0;
    572572  int zahl, signal = test ? 1 : 2; // 0 - ok, 1 - test failed, 2 - throw Error
    573   char suffixdat[255], suffixdoc[255];
     573  char suffixdat[MAXSTRINGSIZE], suffixdoc[MAXSTRINGSIZE];
    574574  int read_type, Num = 0, colorNo = 0;
    575575  char spin[20];
     
    581581  SpeedMeasure(P,ReadnWriteTime,StartTimeDo);
    582582  sprintf(suffixdat, ".%.254s.L%i", P->R.MinimisationName[type], LevSNo);
    583   strncpy (suffixdoc, suffixdat, 255);
     583  strncpy (suffixdoc, suffixdat, MAXSTRINGSIZE);
    584584  // Depending on Psis::SpinType the source psi doc file is opened and header written
    585585  switch (Lat->Psi.PsiST) {
    586586  case SpinDouble:   
    587587    colorNo = 0;
    588     strncat (suffixdat, suffixsrcpsidat, 255-strlen(suffixdat));
    589     strncat (suffixdoc, suffixsrcpsidoc, 255-strlen(suffixdoc));
     588    strncat (suffixdat, suffixsrcpsidat, MAXSTRINGSIZE-strlen(suffixdat));
     589    strncat (suffixdoc, suffixsrcpsidoc, MAXSTRINGSIZE-strlen(suffixdoc));
    590590    strncpy (spin, "GlobalNoSpinDouble", 20);
    591591    Num = Lat->Psi.GlobalNo[PsiMaxNoDouble];
     
    593593  case SpinUp:
    594594    colorNo = 0;
    595     strncat (suffixdat, suffixsrcpsiupdat, 255-strlen(suffixdat));
    596     strncat (suffixdoc, suffixsrcpsiupdoc, 255-strlen(suffixdoc));
     595    strncat (suffixdat, suffixsrcpsiupdat, MAXSTRINGSIZE-strlen(suffixdat));
     596    strncat (suffixdoc, suffixsrcpsiupdoc, MAXSTRINGSIZE-strlen(suffixdoc));
    597597    strncpy (spin, "GlobalNoSpinUp", 20);
    598598    Num = Lat->Psi.GlobalNo[PsiMaxNoUp];
     
    600600  case SpinDown:
    601601    colorNo = 1;
    602     strncat (suffixdat, suffixsrcpsidowndat, 255-strlen(suffixdat));
    603     strncat (suffixdoc, suffixsrcpsidowndoc, 255-strlen(suffixdoc));
     602    strncat (suffixdat, suffixsrcpsidowndat, MAXSTRINGSIZE-strlen(suffixdat));
     603    strncat (suffixdoc, suffixsrcpsidowndoc, MAXSTRINGSIZE-strlen(suffixdoc));
    604604    strncpy (spin, "GlobalNoSpinDown", 20);
    605605    Num = Lat->Psi.GlobalNo[PsiMaxNoDown];
     
    10511051
    10521052  // Open respective file depending on RiemannTensor use
    1053   suffix = (char *) Malloc(sizeof(char)*255, "CombineOutVisDensity: *suffix");
     1053  suffix = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CombineOutVisDensity: *suffix");
    10541054  switch (Lat->RT.ActualUse) {
    10551055  case active:
     
    13171317  int is,ia,i;
    13181318  FILE *SrcIonDoc, *SrcIonData;
    1319   char *suffix = (char *) Malloc(sizeof(char)*255, "CombineOutVisDensity: *suffix");
     1319  char *suffix = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CombineOutVisDensity: *suffix");
    13201320
    13211321  if (!(P->Par.me == 0)) return;
     
    14931493
    14941494  // generate file names
    1495   suffix = (char *) Malloc(sizeof(char)*255, "OutVisIons: * suffix");
     1495  suffix = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "OutVisIons: * suffix");
    14961496  datnamef = (char*)
    14971497    malloc(strlen(P->Files.mainname)+strlen(suffixionfor) + 1);
     
    17761776  time(&seconds); // get current time
    17771777
    1778   filename = (char *) Malloc(sizeof(char)*255, "PlotSrcPlane: *filename");
     1778  filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "PlotSrcPlane: *filename");
    17791779  switch (Lat->Psi.PsiST) {
    17801780    case SpinDouble:   
  • pcp/src/perturbed.c

    r307fd1 rc510a7  
    29752975  }
    29762976
    2977   suffixchi = (char *) Malloc(sizeof(char)*255, "CalculateMagneticSusceptibility: *suffixchi");
     2977  suffixchi = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CalculateMagneticSusceptibility: *suffixchi");
    29782978  // store symmetrized matrix
    29792979  for (in=0;in<NDIM;in++)
     
    31003100  gsl_matrix_complex *H = gsl_matrix_complex_calloc(NDIM,NDIM);
    31013101  FILE *SigmaFile;
    3102   char *suffixsigma = (char *) Malloc(sizeof(char)*255, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma");
     3102  char *suffixsigma = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma");
    31033103 
    31043104  time_t seconds; 
     
    34003400  const int N0 = Lev0->Plan0.plan->local_nx;
    34013401  FILE *MomentFile;
    3402   char *suffixmoment = (char *) Malloc(sizeof(char)*255, "CalculateMagneticMoment: *suffixmoment");
     3402  char *suffixmoment = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CalculateMagneticMoment: *suffixmoment");
    34033403  time_t seconds; 
    34043404  time(&seconds); // get current time
     
    38853885  if (!myPE) { // only process 0 writes to file
    38863886    // open file
    3887     filename = (char *) Malloc(sizeof(char)*255, "PlotVectorPlane: *filename");
     3887    filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "PlotVectorPlane: *filename");
    38883888    sprintf(&filename[0], ".current.L%i.csv", Lev0->LevelNo);
    38893889    OpenFile(P, &PlotFile, filename, "w", P->Call.out[ReadOut]);
  • pcp/src/pseudo.c

    r307fd1 rc510a7  
    483483  PP->lm_endmax = 0;
    484484  PP->corecorr = NotCoreCorrected;
    485   cpiInputFileName = (char *) Malloc(sizeof(char)*255, "InitPseudoRead: *cpiInputFileName");
     485  cpiInputFileName = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "InitPseudoRead: *cpiInputFileName");
    486486  for (it = 0; it < I->Max_Types; it++) {
    487487    PP->lm_end[it] = I->I[it].l_max*I->I[it].l_max+1-2*I->I[it].l_loc;
  • pcp/src/wannier.c

    r307fd1 rc510a7  
    18751875 
    18761876  if (P->Par.me_comm_ST == 0) {
    1877     tagname = (char *) Malloc(sizeof(char)*255, "ParseWannierFile: *tagname");
     1877    tagname = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "ParseWannierFile: *tagname");
    18781878    if(!OpenFile(P, &SpreadFile, suffix, "r", P->Call.out[ReadOut])) { // check if file exists
    18791879      if (MPI_Bcast(&signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)
Note: See TracChangeset for help on using the changeset viewer.