Subject: pkg/20009: fluxbox improperly uses return value of setlocale(3)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <anonymous@on.the.net>
List: netbsd-bugs
Date: 01/23/2003 02:48:04
>Number:         20009
>Category:       pkg
>Synopsis:       fluxbox improperly uses return value of setlocale(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 23 02:49:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     anonymous@2ch.net
>Release:        pkgsrc 2003-01-22
>Organization:
>Environment:
>Description:
Fluxbox improperly uses the return value of setlocale(3).
This causes catopen(3) to fail.

This PR was registered at fluxbox's bugbox last month.

>How-To-Repeat:

>Fix:
Patch for fluxbox-0.1.14

--- src/i18n.cc.orig	Sat Dec  7 23:14:05 2002
+++ src/i18n.cc	Fri Dec 13 22:49:50 2002
@@ -61,7 +61,9 @@
 I18n::I18n():m_multibyte(false), m_catalog_fd((nl_catd)(-1)) {
 #ifdef		HAVE_SETLOCALE
 	//make sure we don't get 0 to m_locale string
-	char *temp = setlocale(LC_ALL, "");
+	char *temp;
+	(void)setlocale(LC_ALL, "");
+	temp = setlocale(LC_MESSAGES, NULL);
 	m_locale = ( temp ?  temp : ""); 
 	if (m_locale.size() == 0) {
 		cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl;

>Release-Note:
>Audit-Trail:
>Unformatted: