From 95a7062faddaeff013cd132f6bba32388fb4ae8a Mon Sep 17 00:00:00 2001
From: zeromus <zeromus@zeromus.org>
Date: Thu, 18 Jun 2015 03:05:39 +0000
Subject: [PATCH] bsnes/nall - fix dangling references bug in stringify

---
 libsnes/bsnes/nall/string/cast.hpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libsnes/bsnes/nall/string/cast.hpp b/libsnes/bsnes/nall/string/cast.hpp
index 7c7e276bb9..c7874515c6 100644
--- a/libsnes/bsnes/nall/string/cast.hpp
+++ b/libsnes/bsnes/nall/string/cast.hpp
@@ -131,13 +131,17 @@ template<> struct stringify<const char*> {
 };
 
 template<> struct stringify<string> {
-  const string &value;
+	//zero 17-jun-2015 - this is a bug. dangling reference can and will go out of scope
+  //const string &value;
+	string value;
   operator const char*() const { return value; }
   stringify(const string &value) : value(value) {}
 };
 
 template<> struct stringify<const string&> {
-  const string &value;
+	//zero 17-jun-2015 - this is a bug. dangling reference can and will go out of scope
+  //const string &value;
+	string value;
   operator const char*() const { return value; }
   stringify(const string &value) : value(value) {}
 };