From a8e7bf210ca1f00a13ce592cf19c7904dc13afb5 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Wed, 26 Feb 2020 13:49:03 -0800 Subject: Fix Util: No Variable-Length Array (#750) Defining a variable-length array (VLA) is a C99 feature. It's conditional in C11 and actually not part of C++ either :) --- Source/Utils/WarpXUtil.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'Source/Utils/WarpXUtil.cpp') diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp index 36d81a7e1..48f454721 100644 --- a/Source/Utils/WarpXUtil.cpp +++ b/Source/Utils/WarpXUtil.cpp @@ -182,18 +182,13 @@ namespace WarpXUtilIO{ void Store_parserString(amrex::ParmParse& pp, std::string query_string, std::string& stored_string) { - - char cstr[query_string.size()+1]; - strcpy(cstr, query_string.c_str()); - std::vector f; - pp.getarr(cstr, f); + pp.getarr(query_string.c_str(), f); stored_string.clear(); for (auto const& s : f) { stored_string += s; } f.clear(); - } -- cgit v1.2.3