all repos — fluxbox @ 07af4ff5959d2ba358d4681aed3c9fe1cc30f74e

custom fork of the fluxbox windowmanager

fix usage of setlocale return value, which returns a pointer to static
memory, which we need to promptly copy
rathnor rathnor
commit

07af4ff5959d2ba358d4681aed3c9fe1cc30f74e

parent

da3f06b278e99b9ffcca2ba12582122c4ece7b52

2 files changed, 8 insertions(+), 5 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.11 +*04/10/04: + * Fix handling of setlocale return (Thanks Victor Yegorov) + FbTk/XmbFontImp.cc *04/09/30: * Fix to show title of current tabbed-window as the label of the iconbar-button-group (Mathias)
M src/FbTk/XmbFontImp.ccsrc/FbTk/XmbFontImp.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: XmbFontImp.cc,v 1.13 2004/09/11 22:58:20 fluxgen Exp $ +// $Id: XmbFontImp.cc,v 1.14 2004/10/04 12:43:52 rathnor Exp $ #include "XmbFontImp.hh"

@@ -117,7 +117,7 @@ const int FONT_ELEMENT_SIZE=50;

char **missing, *def = "-"; int nmissing, pixel_size = 0, buf_size = 0; char weight[FONT_ELEMENT_SIZE], slant[FONT_ELEMENT_SIZE]; - char * orig_locale = ""; + std::string orig_locale = ""; #ifdef HAVE_SETLOCALE if (utf8mode) {

@@ -131,7 +131,7 @@

if (fs && (! nmissing)) { #ifdef HAVE_SETLOCALE if (utf8mode) - setlocale(LC_CTYPE, orig_locale); + setlocale(LC_CTYPE, orig_locale.c_str()); #endif // HAVE_SETLOCALE return fs; }

@@ -143,7 +143,7 @@

setlocale(LC_CTYPE, "C"); fs = XCreateFontSet(display, fontname, &missing, &nmissing, &def); - setlocale(LC_CTYPE, orig_locale); + setlocale(LC_CTYPE, orig_locale.c_str()); } #endif // HAVE_SETLOCALE

@@ -189,7 +189,7 @@ delete [] pattern2;

#ifdef HAVE_SETLOCALE if (utf8mode) - setlocale(LC_CTYPE, orig_locale); + setlocale(LC_CTYPE, orig_locale.c_str()); #endif // HAVE_SETLOCALE return fs;