Updated information about YAZ.
[yaz-moved-to-github.git] / util / atoin.c
1 /*
2  * Copyright (c) 1997, Index Data
3  * See the file LICENSE for details.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: atoin.c,v $
7  * Revision 1.2  1999-11-30 13:47:12  adam
8  * Improved installation. Moved header files to include/yaz.
9  *
10  * Revision 1.1  1997/09/04 07:52:27  adam
11  * Moved atoi_n function to separate source file.
12  *
13  */
14
15 #include <string.h>
16 #include <ctype.h>
17 #include <yaz/yaz-util.h>
18
19 int atoi_n (const char *buf, int len)
20 {
21     int val = 0;
22
23     while (--len >= 0)
24     {
25         if (isdigit (*buf))
26             val = val*10 + (*buf - '0');
27         buf++;
28     }
29     return val;
30 }