forked from lijiext/lammps
avoid array overflows and silence compiler warnings
This commit is contained in:
parent
090fc7bc8a
commit
385cf2e1fc
|
@ -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 ){
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 };
|
||||
|
|
Loading…
Reference in New Issue