Style inquistion for util and some tools.

This commit is contained in:
Christoph Lohmann
2013-03-05 21:46:48 +01:00
parent 52d39e35c2
commit f8dc6883a3
15 changed files with 100 additions and 32 deletions

View File

@@ -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;
}