1
0
mirror of git://git.suckless.org/sbase synced 2024-12-22 23:13:44 +00:00
sbase/libutil/estrtod.c
2014-11-17 16:48:34 +00:00

19 lines
302 B
C

/* 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;
}