2 * Copyright (c) 1997-2004, Index Data
3 * See the file LICENSE for details.
5 * $Id: atoin.c,v 1.4 2004-12-13 14:21:55 heikki Exp $
10 * \brief Implements atoi_n function.
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');