master xplshn/aruu / shared / libutil / estrtod.c
 1/* See LICENSE file for copyright and license details. */
 2#include <errno.h>
 3#include <stdio.h>
 4#include <stdlib.h>
 5
 6#include "../util.h"
 7
 8double
 9estrtod(const char *s)
10{
11	char *end;
12	double d;
13
14	d = strtod(s, &end);
15	if (end == s || *end != '\0')
16		eprintf("%s: not a real number\n", s);
17	return d;
18}