1872b698pfg/*-
2872b698pfg * SPDX-License-Identifier: BSD-3-Clause
3872b698pfg *
4be22b15rgrimes * Copyright (c) 1988, 1993
5be22b15rgrimes *	The Regents of the University of California.  All rights reserved.
6be22b15rgrimes *
70f6ef69theraven * Copyright (c) 2011 The FreeBSD Foundation
80f6ef69theraven * All rights reserved.
90f6ef69theraven * Portions of this software were developed by David Chisnall
100f6ef69theraven * under sponsorship from the FreeBSD Foundation.
110f6ef69theraven *
12be22b15rgrimes * Redistribution and use in source and binary forms, with or without
13be22b15rgrimes * modification, are permitted provided that the following conditions
14be22b15rgrimes * are met:
15be22b15rgrimes * 1. Redistributions of source code must retain the above copyright
16be22b15rgrimes *    notice, this list of conditions and the following disclaimer.
17be22b15rgrimes * 2. Redistributions in binary form must reproduce the above copyright
18be22b15rgrimes *    notice, this list of conditions and the following disclaimer in the
19be22b15rgrimes *    documentation and/or other materials provided with the distribution.
20324e4c0emaste * 3. Neither the name of the University nor the names of its contributors
21be22b15rgrimes *    may be used to endorse or promote products derived from this software
22be22b15rgrimes *    without specific prior written permission.
23be22b15rgrimes *
24be22b15rgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25be22b15rgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26be22b15rgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27be22b15rgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28be22b15rgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29be22b15rgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30be22b15rgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31be22b15rgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32be22b15rgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33be22b15rgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34be22b15rgrimes * SUCH DAMAGE.
35be22b15rgrimes */
36be22b15rgrimes
37be22b15rgrimes#if defined(LIBC_SCCS) && !defined(lint)
38be22b15rgrimesstatic char sccsid[] = "@(#)atof.c	8.1 (Berkeley) 6/4/93";
39be22b15rgrimes#endif /* LIBC_SCCS and not lint */
40d90536eobrien#include <sys/cdefs.h>
41d90536eobrien__FBSDID("$FreeBSD$");
42be22b15rgrimes
43be22b15rgrimes#include <stdlib.h>
440f6ef69theraven#include <xlocale.h>
45be22b15rgrimes
46be22b15rgrimesdouble
475919af4rodrigcatof(const char *ascii)
48be22b15rgrimes{
49a6e7c78ache	return strtod(ascii, (char **)NULL);
50be22b15rgrimes}
510f6ef69theraven
520f6ef69theravendouble
535919af4rodrigcatof_l(const char *ascii, locale_t locale)
540f6ef69theraven{
550f6ef69theraven	return strtod_l(ascii, (char **)NULL, locale);
560f6ef69theraven}
57