repo.or.cz
/
dragora.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
upgrade xorg-server to version 1.19.6
[dragora.git]
/
archive
/
sinit
/
killall5
/
estrtol.c
blob
abc6fe892ff64fc520573246087050fdcc7ecd16
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
long
9
estrtol
(
const char
*
s
,
int
base
)
10
{
11
char
*
end
;
12
long
n
;
13
14
errno
=
0
;
15
n
=
strtol
(
s
, &
end
,
base
);
16
if
(*
end
!=
'\0'
) {
17
if
(
base
==
0
)
18
eprintf
(
"%s: not an integer
\n
"
,
s
);
19
else
20
eprintf
(
"%s: not a base %d integer
\n
"
,
s
,
base
);
21
}
22
if
(
errno
!=
0
)
23
eprintf
(
"%s:"
,
s
);
24
25
return
n
;
26
}
27