1
0
mirror of git://git.suckless.org/sbase synced 2024-12-23 15:34:38 +00:00
sbase/util/estrtol.c
Connor Lane Smith 954106050f rename estrtol
2011-06-10 14:55:01 +01:00

21 lines
357 B
C

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