Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 10 Nov 2015 20:42:40 +0000
From: Josiah Worcester <josiahw@...il.com>
To: musl@...ts.openwall.com
Subject: Re: [BUG] nl_langinfo returns NULL instead of empty string

On Tue, Nov 10, 2015 at 12:26 PM <smidjar2.reg@...il.cz> wrote:

> Manual page for nl_langinfo() function says it should return an empty
> string when 'item' is not valid. Musl's implementation currently returns
> NULL. This is causing issue for applications compiled against glibc
> using gnu extensions, such as 'GROUPING' (0x10002) item (which is
> returning '\003\003' for glibc on my system, but NULL when using musl).
>
> One example of such application is 'Champions of Regnum' game. It is
> crashing with musl, because it strncpy() a string returned from the
> function.
>

POSIX agrees:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/nl_langinfo.html
clearly
states "In all locales, these functions shall return a pointer to an empty
string if item contains an invalid setting."
Good catch.

Content of type "text/html" skipped

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.