diff options
author | 2020-02-26 13:49:03 -0800 | |
---|---|---|
committer | 2020-02-26 13:49:03 -0800 | |
commit | a8e7bf210ca1f00a13ce592cf19c7904dc13afb5 (patch) | |
tree | b2f25eba2f4b6d7819aa6fc6afbd4ee3fbc566b6 /Source/Utils/WarpXUtil.cpp | |
parent | 846c54ec7627513cb470e69aee32eac1b5fc45e7 (diff) | |
download | WarpX-a8e7bf210ca1f00a13ce592cf19c7904dc13afb5.tar.gz WarpX-a8e7bf210ca1f00a13ce592cf19c7904dc13afb5.tar.zst WarpX-a8e7bf210ca1f00a13ce592cf19c7904dc13afb5.zip |
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 :)
Diffstat (limited to '')
-rw-r--r-- | Source/Utils/WarpXUtil.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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<std::string> 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(); - } |