From bd3bd37e961c90dd32c9a0166eec88edd2785d1a Mon Sep 17 00:00:00 2001
From: Niels Lohmann <niels.lohmann@gmail.com>
Date: Wed, 24 Aug 2016 21:29:28 +0200
Subject: [PATCH 1/3] removed coverity badge (build is broken, see #299)

---
 README.md | 1 -
 1 file changed, 1 deletion(-)

diff --git a/README.md b/README.md
index 3015e860..f03b3125 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,6 @@
 [![Build Status](https://travis-ci.org/nlohmann/json.svg?branch=master)](https://travis-ci.org/nlohmann/json)
 [![Build Status](https://ci.appveyor.com/api/projects/status/1acb366xfyg3qybk?svg=true)](https://ci.appveyor.com/project/nlohmann/json)
 [![Coverage Status](https://img.shields.io/coveralls/nlohmann/json.svg)](https://coveralls.io/r/nlohmann/json)
-[![Coverity Scan Build Status](https://scan.coverity.com/projects/5550/badge.svg)](https://scan.coverity.com/projects/nlohmann-json)
 [![Try online](https://img.shields.io/badge/try-online-blue.svg)](http://melpon.org/wandbox/permlink/p5o4znPnGHJpDVqN)
 [![Documentation](https://img.shields.io/badge/docs-doxygen-blue.svg)](http://nlohmann.github.io/json)
 [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/nlohmann/json/master/LICENSE.MIT)

From 87dea32e8162d2b17968a5d9fe8dcb87fa8efc54 Mon Sep 17 00:00:00 2001
From: Niels Lohmann <niels.lohmann@gmail.com>
Date: Wed, 24 Aug 2016 21:31:11 +0200
Subject: [PATCH 2/3] using AppVeyor badge for develop branch

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index f03b3125..bf127638 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 [![JSON for Modern C++](https://raw.githubusercontent.com/nlohmann/json/master/doc/json.gif)](https://github.com/nlohmann/json/releases)
 
 [![Build Status](https://travis-ci.org/nlohmann/json.svg?branch=master)](https://travis-ci.org/nlohmann/json)
-[![Build Status](https://ci.appveyor.com/api/projects/status/1acb366xfyg3qybk?svg=true)](https://ci.appveyor.com/project/nlohmann/json)
+[![Build Status](https://ci.appveyor.com/api/projects/status/1acb366xfyg3qybk/branch/develop?svg=true)](https://ci.appveyor.com/project/nlohmann/json)
 [![Coverage Status](https://img.shields.io/coveralls/nlohmann/json.svg)](https://coveralls.io/r/nlohmann/json)
 [![Try online](https://img.shields.io/badge/try-online-blue.svg)](http://melpon.org/wandbox/permlink/p5o4znPnGHJpDVqN)
 [![Documentation](https://img.shields.io/badge/docs-doxygen-blue.svg)](http://nlohmann.github.io/json)

From 29c5f32d4287a49f59fcd65b7ffacd7f154b03aa Mon Sep 17 00:00:00 2001
From: Niels <niels.lohmann@gmail.com>
Date: Mon, 29 Aug 2016 22:36:33 +0200
Subject: [PATCH 3/3] fixed performance degradation (#272)

---
 Makefile          | 3 +++
 src/json.hpp      | 3 ++-
 src/json.hpp.re2c | 3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index b53d8d3d..4c96bad7 100644
--- a/Makefile
+++ b/Makefile
@@ -66,6 +66,9 @@ fuzz: test/src/fuzz.cpp src/json.hpp
 cppcheck:
 	cppcheck --enable=warning --inconclusive --force --std=c++11 src/json.hpp --error-exitcode=1
 
+clang_sanitize: clean
+	CXX=clang++ CXXFLAGS="-g -O2 -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer" $(MAKE)
+
 ##########################################################################
 # maintainer targets
 ##########################################################################
diff --git a/src/json.hpp b/src/json.hpp
index b5e24206..d6f8925f 100644
--- a/src/json.hpp
+++ b/src/json.hpp
@@ -2232,7 +2232,8 @@ class basic_json
     {
         std::stringstream ss;
         // fix locale problems
-        ss.imbue(std::locale(std::locale(), new DecimalSeparator));
+        const static std::locale loc(std::locale(), new DecimalSeparator);
+        ss.imbue(loc);
 
         // 6, 15 or 16 digits of precision allows round-trip IEEE 754
         // string->float->string, string->double->string or string->long
diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c
index fdc00638..75fc27e5 100644
--- a/src/json.hpp.re2c
+++ b/src/json.hpp.re2c
@@ -2232,7 +2232,8 @@ class basic_json
     {
         std::stringstream ss;
         // fix locale problems
-        ss.imbue(std::locale(std::locale(), new DecimalSeparator));
+        const static std::locale loc(std::locale(), new DecimalSeparator);
+        ss.imbue(loc);
 
         // 6, 15 or 16 digits of precision allows round-trip IEEE 754
         // string->float->string, string->double->string or string->long