2 * Copyright (c) 1997-2004, Index Data
3 * See the file LICENSE for details.
5 * $Id: atoin.c,v 1.3 2004-10-15 00:18:59 adam Exp $
10 * \brief Implements atoi_n function.
19 #include <yaz/yaz-util.h>
22 * atoi_n: like atoi but reads at most len characters.
24 int atoi_n (const char *buf, int len)
30 if (isdigit (*(const unsigned char *) buf))
31 val = val*10 + (*buf - '0');