From owner-freebsd-arch Sun Jan 27 12:11:31 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mail.acns.ab.ca (mail.acns.ab.ca [142.179.151.95]) by hub.freebsd.org (Postfix) with ESMTP id 5923737B419; Sun, 27 Jan 2002 12:11:26 -0800 (PST) Received: from colnta.acns.ab.ca (colnta.acns.ab.ca [192.168.1.2]) by mail.acns.ab.ca (8.11.6/8.11.3) with ESMTP id g0RKBPV14710; Sun, 27 Jan 2002 13:11:25 -0700 (MST) (envelope-from davidc@colnta.acns.ab.ca) Received: (from davidc@localhost) by colnta.acns.ab.ca (8.11.6/8.11.3) id g0RKBPY42827; Sun, 27 Jan 2002 13:11:25 -0700 (MST) (envelope-from davidc) Date: Sun, 27 Jan 2002 13:11:25 -0700 From: Chad David To: Alexey Zelkin Cc: Chad David , "Andrey A. Chernov" , "Brian F. Feldman" , Bruce Evans , arch@FreeBSD.ORG Subject: Re: strtod() Message-ID: <20020127131125.B42735@colnta.acns.ab.ca> Mail-Followup-To: Alexey Zelkin , Chad David , "Andrey A. Chernov" , "Brian F. Feldman" , Bruce Evans , arch@FreeBSD.ORG References: <20020126162924.A7726@colnta.acns.ab.ca> <200201270453.g0R4rwi92912@green.bikeshed.org> <20020127070421.GA13415@nagual.pp.ru> <20020127003719.A38420@colnta.acns.ab.ca> <20020127171925.A14791@phantom.cris.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020127171925.A14791@phantom.cris.net>; from phantom@FreeBSD.ORG on Sun, Jan 27, 2002 at 05:19:25PM +0200 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Jan 27, 2002 at 05:19:25PM +0200, Alexey Zelkin wrote: > hi, > > On Sun, Jan 27, 2002 at 12:37:19AM -0700, Chad David wrote: > > > The attached patch fixes this case, and probably others. Comments? > > > > Index: localeconv.c > > =================================================================== > > RCS file: /mnt1/ncvs/src/lib/libc/locale/localeconv.c,v > > retrieving revision 1.3 > > diff -u -d -r1.3 localeconv.c > > --- localeconv.c 10 Feb 2001 02:00:56 -0000 1.3 > ^^^^^^^^^^^ > > +++ localeconv.c 27 Jan 2002 07:28:51 -0000 > ^^^^^^^^^^^ > > You current seems too old. And I'd suggest to update it first before > making tests. At the begining of the last year many locale oriented things > were changed. > Just this one file (as I mentioned in my last email) :(. The differences between 1.3 are pretty minor though, and they do not affect this. colnta->cvs diff -ud -r 1.3 localeconv.c Index: localeconv.c =================================================================== RCS file: /mnt1/ncvs/src/lib/libc/locale/localeconv.c,v retrieving revision 1.3 retrieving revision 1.9 diff -u -d -r1.3 -r1.9 --- localeconv.c 10 Feb 2001 02:00:56 -0000 1.3 +++ localeconv.c 20 Dec 2001 15:30:02 -0000 1.9 [cut copyright] @@ -29,11 +36,13 @@ #if 0 static char sccsid[] = "@(#)localeconv.c 8.1 (Berkeley) 6/4/93"; #endif -static char rcsid[] = "$FreeBSD: src/lib/libc/locale/localeconv.c,v 1.3 2001/02/10 02:00:56 ache Exp $"; +static char rcsid[] = + "$FreeBSD: src/lib/libc/locale/localeconv.c,v 1.9 2001/12/20 15:30:02 phantom Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include +#include #include "lmonetary.h" #include "lnumeric.h" @@ -51,7 +60,10 @@ static char cnv(char *str) { - return (char)strtol(str, NULL, 0); + int i = strtol(str, NULL, 10); + if (i == -1) + i = CHAR_MAX; + return (char)i; } This change here detected that strtol() was failing, but didn't fix errno. -- Chad David davidc@acns.ab.ca www.FreeBSD.org davidc@freebsd.org ACNS Inc. Calgary, Alberta Canada Fourthly, The constant breeders, beside the gain of eight shillings sterling per annum by the sale of their children, will be rid of the charge of maintaining them after the first year. - Johnathan Swift To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message