Style inquistion for util and some tools.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../util.h"
|
||||
|
||||
long
|
||||
@@ -9,14 +10,17 @@ estrtol(const char *s, int base)
|
||||
{
|
||||
char *end;
|
||||
long n;
|
||||
|
||||
|
||||
errno = 0;
|
||||
n = strtol(s, &end, base);
|
||||
if(*end != '\0' || errno != 0) {
|
||||
if(base == 0)
|
||||
if(base == 0) {
|
||||
eprintf("%s: not an integer\n", s);
|
||||
else
|
||||
} else {
|
||||
eprintf("%s: not a base %d integer\n", s, base);
|
||||
}
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user