Commit 385cf2e1 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid array overflows and silence compiler warnings

parent 090fc7bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
                       output_controls *out_control, mpi_datatypes *mpi_data,
                       char *msg )
{
  char temp[MAX_STR];
  char temp[MAX_STR+8];
  int ret;

  if( out_control->write_steps > 0 ){
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ int Tokenize( char* s, char*** tok )
  char *word;
  int count=0;

  strncpy( test, s, MAX_LINE );
  strncpy( test, s, MAX_LINE-1);

  for( word = strtok(test, sep); word; word = strtok(NULL, sep) ) {
    strncpy( (*tok)[count], word, MAX_LINE );
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ int Init_Traj( reax_system *system, control_params *control,
               output_controls *out_control, mpi_datatypes *mpi_data,
               char *msg )
{
  char fname[MAX_STR];
  char fname[MAX_STR+8];
  int  atom_line_len[ NR_OPT_ATOM ] = { 0, 0, 0, 0,
                                        ATOM_BASIC_LEN, ATOM_wV_LEN,
                                        ATOM_wF_LEN, ATOM_FULL_LEN };