diff --git a/headers/os/locale/Catalog.h b/headers/os/locale/Catalog.h index 30db9861c8..a68e471e85 100644 --- a/headers/os/locale/Catalog.h +++ b/headers/os/locale/Catalog.h @@ -57,7 +57,8 @@ class BCatalog { // This must be included (statically linked) into each shared object needing // a catalog on its own (application, add-on, library, ...). The shared object // must also have a mimetype so that the catalog can be identified. -class BCatalogStub { +class BCatalogStub +{ private: static BCatalog sCatalog; static vint32 sCatalogInitOnce; diff --git a/src/kits/locale/CatalogStub.cpp b/src/kits/locale/CatalogStub.cpp index fea914c0d2..d7be4dfcc7 100644 --- a/src/kits/locale/CatalogStub.cpp +++ b/src/kits/locale/CatalogStub.cpp @@ -19,10 +19,15 @@ vint32 BCatalogStub::sCatalogInitOnce = false; /* static */ BCatalog* BCatalogStub::GetCatalog() { + #if (__GNUC__ < 3) + asm volatile(".hidden GetCatalog__12BCatalogStub"); + #else + asm volatile(".hidden _ZN12BCatalogStub10GetCatalogEv"); + #endif + return be_locale_roster->GetCatalog(&sCatalog, &sCatalogInitOnce); } - /* static */ void BCatalogStub::ForceReload() { diff --git a/src/kits/locale/HashMapCatalog.cpp b/src/kits/locale/HashMapCatalog.cpp index 71ab423837..6eff488d45 100644 --- a/src/kits/locale/HashMapCatalog.cpp +++ b/src/kits/locale/HashMapCatalog.cpp @@ -164,7 +164,7 @@ parseQuotedChars(BString& stringToParse) char tmp[3]; tmp[0] = *(in+1); tmp[1] = *(in+2); - tmp[3] = '\0'; + tmp[2] = '\0'; unsigned int hexchar = strtoul(tmp, NULL, 16); *out = hexchar; // skip the number diff --git a/src/tools/locale/HashMapCatalog.cpp b/src/tools/locale/HashMapCatalog.cpp index 7ef31c327b..b59b40f0fb 100644 --- a/src/tools/locale/HashMapCatalog.cpp +++ b/src/tools/locale/HashMapCatalog.cpp @@ -168,7 +168,7 @@ parseQuotedChars(BString& stringToParse) char tmp[3]; tmp[0] = *(in+1); tmp[1] = *(in+2); - tmp[3] = '\0'; + tmp[2] = '\0'; unsigned int hexchar = strtoul(tmp, NULL, 16); *out = hexchar; // skip the number