summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/report.cc b/src/report.cc
index 91b9025d..473308a0 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -657,7 +657,8 @@ value_t report_t::fn_quoted(call_scope_t& args)
std::ostringstream out;
out << '"';
- foreach (const char ch, args.get<string>(0)) {
+ string arg(args.get<string>(0));
+ foreach (const char ch, arg) {
if (ch == '"')
out << "\\\"";
else
@@ -672,7 +673,8 @@ value_t report_t::fn_join(call_scope_t& args)
{
std::ostringstream out;
- foreach (const char ch, args.get<string>(0)) {
+ string arg(args.get<string>(0));
+ foreach (const char ch, arg) {
if (ch != '\n')
out << ch;
else