From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8535 Path: news.gmane.org!not-for-mail From: Julien Ramseier Newsgroups: gmane.linux.lib.musl.general Subject: localeconv and char values Date: Mon, 21 Sep 2015 12:21:34 +0200 Message-ID: <89422A70-4BF6-4733-9400-0932A85857F9@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866" X-Trace: ger.gmane.org 1442830928 12721 80.91.229.3 (21 Sep 2015 10:22:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Sep 2015 10:22:08 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8547-gllmg-musl=m.gmane.org@lists.openwall.com Mon Sep 21 12:22:08 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZdyEX-0004Mi-C4 for gllmg-musl@m.gmane.org; Mon, 21 Sep 2015 12:22:05 +0200 Original-Received: (qmail 12034 invoked by uid 550); 21 Sep 2015 10:22:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11822 invoked from network); 21 Sep 2015 10:21:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:subject:message-id:date:to:mime-version; bh=TKlXZRMR19roRYlDh2vjGXPTtdmfR27KYCPFZnJW5LU=; b=rxLNH3oQct6cLNcwNXMWxdcR39fGKU+H/xni/g0iF8pv4O4daoYdrk0w2RFvPKqZxi sjkRWrDd5zX2M9c6fDdlOpSmZZCZQoQysfX+0WA/1JkHgsyAxlVxkkjXsdPRmSGqHxSU zleSuu2k8pgy1gHCTkbRHZ30vINvhfrU4QSl5kWkEV2zl9s7T3z6TgOiQtYu/9I89BVf jC3/HoF3ZJSGKu9F6A1en2sjZJFCC3DjP+kE9staJ/WreO8Q5Le6YYjRmRzcowSu+fQ1 j2X4tScuxmqdSSehAbxDTde1NtgNZCWakOUJ0Ayazh6oZcQBwcWpdFVMeDMSw37TpS4u 04Fg== X-Received: by 10.180.11.212 with SMTP id s20mr12215319wib.40.1442830896017; Mon, 21 Sep 2015 03:21:36 -0700 (PDT) X-Mailer: Apple Mail (2.2102) Xref: news.gmane.org gmane.linux.lib.musl.general:8535 Archived-At: --Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello, Currently, all the char fields of the lconv struct returned by = localeconv are set to -1. According to = http://pubs.opengroup.org/onlinepubs/9699919799/functions/localeconv.html = , negative values are not valid and CHAR_MAX should be used to indicate = non-available values. If I=E2=80=99m not missing anything, here=E2=80=99s the corresponding = patch: =E2=80=94 Julien --Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866 Content-Type: multipart/mixed; boundary="Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B" --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hello,

Currently, all the char fields of the lconv struct returned = by localeconv are set to -1.

negative values are not valid and = CHAR_MAX should be used to indicate non-available values.

If I=E2=80=99m not = missing anything, here=E2=80=99s the corresponding patch:
= --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B Content-Disposition: attachment; filename=fix-localeconv-char.diff Content-Type: application/octet-stream; name="fix-localeconv-char.diff" Content-Transfer-Encoding: 7bit diff --git a/src/locale/localeconv.c b/src/locale/localeconv.c index cbc75d7..4cbb9dc 100644 --- a/src/locale/localeconv.c +++ b/src/locale/localeconv.c @@ -1,4 +1,5 @@ #include +#include static const struct lconv posix_lconv = { .decimal_point = ".", @@ -11,20 +12,20 @@ static const struct lconv posix_lconv = { .mon_grouping = "", .positive_sign = "", .negative_sign = "", - .int_frac_digits = -1, - .frac_digits = -1, - .p_cs_precedes = -1, - .p_sep_by_space = -1, - .n_cs_precedes = -1, - .n_sep_by_space = -1, - .p_sign_posn = -1, - .n_sign_posn = -1, - .int_p_cs_precedes = -1, - .int_p_sep_by_space = -1, - .int_n_cs_precedes = -1, - .int_n_sep_by_space = -1, - .int_p_sign_posn = -1, - .int_n_sign_posn = -1, + .int_frac_digits = CHAR_MAX, + .frac_digits = CHAR_MAX, + .p_cs_precedes = CHAR_MAX, + .p_sep_by_space = CHAR_MAX, + .n_cs_precedes = CHAR_MAX, + .n_sep_by_space = CHAR_MAX, + .p_sign_posn = CHAR_MAX, + .n_sign_posn = CHAR_MAX, + .int_p_cs_precedes = CHAR_MAX, + .int_p_sep_by_space = CHAR_MAX, + .int_n_cs_precedes = CHAR_MAX, + .int_n_sep_by_space = CHAR_MAX, + .int_p_sign_posn = CHAR_MAX, + .int_n_sign_posn = CHAR_MAX, }; struct lconv *localeconv(void) --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

=E2=80=94
Julien
= --Apple-Mail=_D518546F-3FF8-4EDE-9991-E7CC949F234B-- --Apple-Mail=_5A89BD1B-DDEF-4052-8711-2CF879E94866--