summaryrefslogtreecommitdiff
path: root/src/abaddon.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-08-03 02:27:43 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-08-03 02:27:43 -0400
commita61a630ee675e18f12e8725cca731cbe8aa429ce (patch)
tree7705056668804da6ddcefa1752afde93122a70ff /src/abaddon.cpp
parent4e4986f6709cfc7f8e4cae734e8579695f3c07b4 (diff)
downloadabaddon-portaudio-a61a630ee675e18f12e8725cca731cbe8aa429ce.tar.gz
abaddon-portaudio-a61a630ee675e18f12e8725cca731cbe8aa429ce.zip
handle null from std::locale::locale (fixes #88)
Diffstat (limited to 'src/abaddon.cpp')
-rw-r--r--src/abaddon.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/abaddon.cpp b/src/abaddon.cpp
index 2e8ecaa..c849fd6 100644
--- a/src/abaddon.cpp
+++ b/src/abaddon.cpp
@@ -898,11 +898,15 @@ int main(int argc, char **argv) {
char *systemLocale = std::setlocale(LC_ALL, "");
try {
- std::locale::global(std::locale(systemLocale));
+ if (systemLocale != nullptr) {
+ std::locale::global(std::locale(systemLocale));
+ }
} catch (...) {
try {
std::locale::global(std::locale::classic());
- std::setlocale(LC_ALL, systemLocale);
+ if (systemLocale != nullptr) {
+ std::setlocale(LC_ALL, systemLocale);
+ }
} catch (...) {}
}