aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2011-01-15 13:36:03 -0800
committerJing Yu <jingyu@google.com>2011-01-15 13:38:21 -0800
commitb6be42e837844cce5283f42fcfac31e6d66a277d (patch)
tree21dacb55c01c9c2c1c72e9dee9d6e361461934e1 /gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h
parent88e20bebc10f931336868b211ff40e3001f0664b (diff)
downloadtoolchain_gcc-b6be42e837844cce5283f42fcfac31e6d66a277d.tar.gz
toolchain_gcc-b6be42e837844cce5283f42fcfac31e6d66a277d.tar.bz2
toolchain_gcc-b6be42e837844cce5283f42fcfac31e6d66a277d.zip
libstdc++-v3: fix setlocale()-related crash.
The Android setlocale() returns NULL, which was not handled properly by the standard library code. Add a simple test the check for this condition. Bionic will fix this problem. Keep this patch local in order to be able to target previous/existing releases of the platform. Change-Id: I76a51dcfea8d7e41c4ace5178b24bf42c1f7e26e
Diffstat (limited to 'gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h')
-rw-r--r--gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h b/gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h
index 472ef5505..e27a9cdf6 100644
--- a/gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h
+++ b/gcc-4.4.3/libstdc++-v3/config/locale/generic/c_locale.h
@@ -59,7 +59,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
char* __old = std::setlocale(LC_NUMERIC, NULL);
char* __sav = NULL;
- if (__builtin_strcmp(__old, "C"))
+ if (__old != NULL && __builtin_strcmp(__old, "C"))
{
const size_t __len = __builtin_strlen(__old) + 1;
__sav = new char[__len];