2 * Copyright (c) 1997-2004, Index Data
3 * See the file LICENSE for details.
5 * $Id: atoin.c,v 1.5 2004-12-16 08:59:56 adam Exp $
10 * \brief Implements atoi_n function.
19 #include <yaz/marcdisp.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');