Fixed Makefile(s).
[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.1  1997-09-04 07:52:27  adam
8  * Moved atoi_n function to separate source file.
9  *
10  */
11
12 #include <string.h>
13 #include <ctype.h>
14 #include <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 }