aruu

[MIRROR] Actual replacement for Busybox | suckless
git clone https://git.daat.foo/aruu.git
Log | Files | Refs | README | LICENSE

estrtod.c (309B)


      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 
      8 double
      9 estrtod(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 }