rename estrtol

This commit is contained in:
Connor Lane Smith
2011-06-10 14:55:01 +01:00
parent 61247e3595
commit 954106050f
12 changed files with 13 additions and 13 deletions

20
util/estrtol.c Normal file
View File

@@ -0,0 +1,20 @@
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <stdlib.h>
#include "../util.h"
long
estrtol(const char *s, int base)
{
char *end;
long n;
n = strtol(s, &end, base);
if(*end != '\0') {
if(base == 0)
eprintf("%s: not a number\n", s);
else
eprintf("%s: not a base %d number\n", s, base);
}
return n;
}