summaryrefslogtreecommitdiff
path: root/util/sbase/libutil/estrtod.c
blob: 24e4fdcede29deb969bfb2f66448d2102103ebe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* See LICENSE file for copyright and license details. */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>

#include "../util.h"

double
estrtod(const char *s)
{
	char *end;
	double d;

	d = strtod(s, &end);
	if (end == s || *end != '\0')
		eprintf("%s: not a real number\n", s);
	return d;
}