summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/strtof.c
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2008-07-28 23:44:12 +0000
committercvs2svn <admin@example.com>2008-07-28 23:44:12 +0000
commitdaac2f633f49a45baa8412c5e4e71e594236e7b8 (patch)
treec2b7593b6807015d5bd1bbe95841e718a3b3df42 /src/lib/libc/stdlib/strtof.c
parent10837c3c47f1b9d7d1a061fff2327a4e280ba338 (diff)
downloadopenbsd-pre_openssl_0_9_8h.tar.gz
openbsd-pre_openssl_0_9_8h.tar.bz2
openbsd-pre_openssl_0_9_8h.zip
This commit was manufactured by cvs2git to create tag 'pre_openssl_0_9_8h'.pre_openssl_0_9_8h
Diffstat (limited to 'src/lib/libc/stdlib/strtof.c')
-rw-r--r--src/lib/libc/stdlib/strtof.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/lib/libc/stdlib/strtof.c b/src/lib/libc/stdlib/strtof.c
deleted file mode 100644
index 8c8db47ad8..0000000000
--- a/src/lib/libc/stdlib/strtof.c
+++ /dev/null
@@ -1,39 +0,0 @@
1/* $OpenBSD: strtof.c,v 1.1 2008/06/13 21:04:24 landry Exp $ */
2
3/*
4 * Copyright (c) 2008 Landry Breuil
5 * All rights reserved.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#include <errno.h>
21#include <limits.h>
22#include <stdlib.h>
23#include <math.h>
24
25float
26strtof(const char *s00, char **se)
27{
28 double d;
29
30 d = strtod(s00, se);
31 if (d > FLT_MAX) {
32 errno = ERANGE;
33 return (FLT_MAX);
34 } else if (d < -FLT_MAX) {
35 errno = ERANGE;
36 return (-FLT_MAX);
37 }
38 return ((float) d);
39}