@@ -70,13 +70,13 @@ namespace io{
7070
7171 struct with_file_name {
7272 with_file_name (){
73- std::memset (file_name, 0 , max_file_name_length+ 1 );
73+ std::memset (file_name, 0 , sizeof (file_name) );
7474 }
7575
7676 void set_file_name (const char *file_name){
7777 if (file_name != nullptr ){
78- strncpy (this ->file_name , file_name, error::max_file_name_length );
79- this ->file_name [error::max_file_name_length ] = ' \0 ' ;
78+ strncpy (this ->file_name , file_name, sizeof ( this -> file_name ) );
79+ this ->file_name [sizeof ( this -> file_name )- 1 ] = ' \0 ' ;
8080 }else {
8181 this ->file_name [0 ] = ' \0 ' ;
8282 }
@@ -422,8 +422,8 @@ namespace io{
422422
423423 void set_file_name (const char *file_name){
424424 if (file_name != nullptr ){
425- strncpy (this ->file_name , file_name, error::max_file_name_length );
426- this ->file_name [error::max_file_name_length ] = ' \0 ' ;
425+ strncpy (this ->file_name , file_name, sizeof ( this -> file_name ) );
426+ this ->file_name [sizeof ( this -> file_name )- 1 ] = ' \0 ' ;
427427 }else {
428428 this ->file_name [0 ] = ' \0 ' ;
429429 }
@@ -1112,7 +1112,7 @@ namespace io{
11121112 private:
11131113 LineReader in;
11141114
1115- char *( row[column_count]) ;
1115+ char *row[column_count];
11161116 std::string column_names[column_count];
11171117
11181118 std::vector<int >col_order;
0 commit comments