projects
/
yaz-moved-to-github.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
SRW, CQL, 2003
[yaz-moved-to-github.git]
/
util
/
atoin.c
1
/*
2
* Copyright (c) 1997-2003, Index Data
3
* See the file LICENSE for details.
4
*
5
* $Id: atoin.c,v 1.6 2003-01-06 08:20:28 adam Exp $
6
*/
7
8
#if HAVE_CONFIG_H
9
#include <config.h>
10
#endif
11
12
#include <string.h>
13
#include <ctype.h>
14
#include <yaz/yaz-util.h>
15
16
int atoi_n (const char *buf, int len)
17
{
18
int val = 0;
19
20
while (--len >= 0)
21
{
22
if (isdigit (*buf))
23
val = val*10 + (*buf - '0');
24
buf++;
25
}
26
return val;
27
}
28