Skip to content

Commit

Permalink
variable lenght char buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
SymbolixAU committed Mar 16, 2020
1 parent e92ee02 commit 8c7a624
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/read_geojson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
rapidjson::Document buffer_string( const char* file, const char* mode, int buffer_size = 1024 ) {

FILE* fp = fopen(file, mode );
char readBuffer[ buffer_size ];
//char readBuffer[ buffer_size ];
//rapidjson::FileReadStream is(fp, readBuffer, sizeof( readBuffer ) );

// ISO C++ forbids variable length array ‘readBuffer’ [-Wvla]
// https://stackoverflow.com/a/11379442/5977215
char *readBuffer = new char[ buffer_size ];

rapidjson::FileReadStream is(fp, readBuffer, sizeof( readBuffer ) );

Expand Down

0 comments on commit 8c7a624

Please sign in to comment.