@@ -70,13 +70,13 @@ namespace io{
70
70
71
71
struct with_file_name {
72
72
with_file_name (){
73
- std::memset (file_name, 0 , max_file_name_length+ 1 );
73
+ std::memset (file_name, 0 , sizeof (file_name) );
74
74
}
75
75
76
76
void set_file_name (const char *file_name){
77
77
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 ' ;
80
80
}else {
81
81
this ->file_name [0 ] = ' \0 ' ;
82
82
}
@@ -422,8 +422,8 @@ namespace io{
422
422
423
423
void set_file_name (const char *file_name){
424
424
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 ' ;
427
427
}else {
428
428
this ->file_name [0 ] = ' \0 ' ;
429
429
}
@@ -1112,7 +1112,7 @@ namespace io{
1112
1112
private:
1113
1113
LineReader in;
1114
1114
1115
- char *( row[column_count]) ;
1115
+ char *row[column_count];
1116
1116
std::string column_names[column_count];
1117
1117
1118
1118
std::vector<int >col_order;
0 commit comments