diff options
Diffstat (limited to 'src/libutil/strings.cc')
-rw-r--r-- | src/libutil/strings.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/strings.cc b/src/libutil/strings.cc index df48e9203..de9a0eb9f 100644 --- a/src/libutil/strings.cc +++ b/src/libutil/strings.cc @@ -8,7 +8,8 @@ namespace nix { std::vector<char *> stringsToCharPtrs(const Strings & ss) { std::vector<char *> res; - for (auto & s : ss) res.push_back((char *) s.c_str()); + // This is const cast since this exists for OS APIs that want char * + for (auto & s : ss) res.push_back(const_cast<char *>(s.data())); res.push_back(0); return res; } |