This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Andre Charbonneau <andrec@corel.com>] Bug found in localeconv!



I've found the appended report on comp.os.linux.development.system.
I'm appending a proper patch.  The patch is against glibc 2.1, but is
also needed for glibc 2.2.

Andreas

2000-03-14  Andreas Jaeger  <aj@suse.de>

	* locale/localeconv.c (localeconv): Fix typo.
	Reported by Andre Charbonneau <andrec@corel.com>.

Index: locale/localeconv.c
===================================================================
RCS file: /cvs/glibc/libc/locale/localeconv.c,v
retrieving revision 1.5
diff -u -u -r1.5 localeconv.c
--- localeconv.c	1997/02/15 04:28:07	1.5
+++ localeconv.c	2000/03/14 08:44:16
@@ -43,7 +43,7 @@
   result.frac_digits = *(char *) _NL_CURRENT (LC_MONETARY, FRAC_DIGITS);
   result.p_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY, P_CS_PRECEDES);
   result.p_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY, P_SEP_BY_SPACE);
-  result.n_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY, P_CS_PRECEDES);
+  result.n_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY, N_CS_PRECEDES);
   result.n_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY, N_SEP_BY_SPACE);
   result.p_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY, P_SIGN_POSN);
   result.n_sign_posn = *(char *) _NL_CURRENT (LC_MONETARY, N_SIGN_POSN);




Topics:
   Bug found in localeconv!


----------------------------------------------------------------------

Date: Mon, 13 Mar 2000 10:13:53 -0800
From: Andre Charbonneau <andrec@corel.com>
Subject: Bug found in localeconv!
Message-ID: <38CD2FE1.C793D507@corel.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi

I found a bug in localeconv and isolated the part of the code which
contains the bug.  Here it is:

  result.p_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY,
P_CS_PRECEDES);
  result.p_sep_by_space = *(char *) _NL_CURRENT (LC_MONETARY,
P_SEP_BY_SPACE);
  result.n_cs_precedes = *(char *) _NL_CURRENT (LC_MONETARY,
P_CS_PRECEDES);

The above 3 lines are from localeconv.c.  Notice that the bug is in the
3rd line (above)... it should use N_CS_PRECEDES instead of
P_CS_PRECEDES.

(To get around the bug, ln_langinfo can be used...)

I'm not sure if this is the proper place to post the bug.  If not, I
would appreciate if someone tell me where I should post the bug report.

Thanks,
- - 
Andre Charbonneau
Software Engineer
Corel Corporation
728-0826 x5612

------------------------------

End of forwardTxBC72 Digest
***************************



-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]