diff options
author | rathnor <rathnor> | 2004-10-04 12:43:52 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-10-04 12:43:52 (GMT) |
commit | 07af4ff5959d2ba358d4681aed3c9fe1cc30f74e (patch) | |
tree | 4aef36626d015089baf3247d57ff4668716550ee /src | |
parent | da3f06b278e99b9ffcca2ba12582122c4ece7b52 (diff) | |
download | fluxbox_pavel-07af4ff5959d2ba358d4681aed3c9fe1cc30f74e.zip fluxbox_pavel-07af4ff5959d2ba358d4681aed3c9fe1cc30f74e.tar.bz2 |
fix usage of setlocale return value, which returns a pointer to static
memory, which we need to promptly copy
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/XmbFontImp.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc index eb01596..dc5c902 100644 --- a/src/FbTk/XmbFontImp.cc +++ b/src/FbTk/XmbFontImp.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: XmbFontImp.cc,v 1.13 2004/09/11 22:58:20 fluxgen Exp $ | 22 | // $Id: XmbFontImp.cc,v 1.14 2004/10/04 12:43:52 rathnor Exp $ |
23 | 23 | ||
24 | #include "XmbFontImp.hh" | 24 | #include "XmbFontImp.hh" |
25 | 25 | ||
@@ -117,7 +117,7 @@ XFontSet createFontSet(const char *fontname, bool utf8mode) { | |||
117 | char **missing, *def = "-"; | 117 | char **missing, *def = "-"; |
118 | int nmissing, pixel_size = 0, buf_size = 0; | 118 | int nmissing, pixel_size = 0, buf_size = 0; |
119 | char weight[FONT_ELEMENT_SIZE], slant[FONT_ELEMENT_SIZE]; | 119 | char weight[FONT_ELEMENT_SIZE], slant[FONT_ELEMENT_SIZE]; |
120 | char * orig_locale = ""; | 120 | std::string orig_locale = ""; |
121 | 121 | ||
122 | #ifdef HAVE_SETLOCALE | 122 | #ifdef HAVE_SETLOCALE |
123 | if (utf8mode) { | 123 | if (utf8mode) { |
@@ -131,7 +131,7 @@ XFontSet createFontSet(const char *fontname, bool utf8mode) { | |||
131 | if (fs && (! nmissing)) { | 131 | if (fs && (! nmissing)) { |
132 | #ifdef HAVE_SETLOCALE | 132 | #ifdef HAVE_SETLOCALE |
133 | if (utf8mode) | 133 | if (utf8mode) |
134 | setlocale(LC_CTYPE, orig_locale); | 134 | setlocale(LC_CTYPE, orig_locale.c_str()); |
135 | #endif // HAVE_SETLOCALE | 135 | #endif // HAVE_SETLOCALE |
136 | return fs; | 136 | return fs; |
137 | } | 137 | } |
@@ -143,7 +143,7 @@ XFontSet createFontSet(const char *fontname, bool utf8mode) { | |||
143 | setlocale(LC_CTYPE, "C"); | 143 | setlocale(LC_CTYPE, "C"); |
144 | fs = XCreateFontSet(display, fontname, | 144 | fs = XCreateFontSet(display, fontname, |
145 | &missing, &nmissing, &def); | 145 | &missing, &nmissing, &def); |
146 | setlocale(LC_CTYPE, orig_locale); | 146 | setlocale(LC_CTYPE, orig_locale.c_str()); |
147 | } | 147 | } |
148 | #endif // HAVE_SETLOCALE | 148 | #endif // HAVE_SETLOCALE |
149 | 149 | ||
@@ -189,7 +189,7 @@ XFontSet createFontSet(const char *fontname, bool utf8mode) { | |||
189 | 189 | ||
190 | #ifdef HAVE_SETLOCALE | 190 | #ifdef HAVE_SETLOCALE |
191 | if (utf8mode) | 191 | if (utf8mode) |
192 | setlocale(LC_CTYPE, orig_locale); | 192 | setlocale(LC_CTYPE, orig_locale.c_str()); |
193 | #endif // HAVE_SETLOCALE | 193 | #endif // HAVE_SETLOCALE |
194 | 194 | ||
195 | return fs; | 195 | return fs; |