1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
8 * \brief Implements atoi_n function.
17 #include <yaz/marcdisp.h>
20 * atoi_n: like atoi but reads at most len characters.
22 int atoi_n (const char *buf, int len)
28 if (isdigit (*(const unsigned char *) buf))
29 val = val*10 + (*buf - '0');
38 * indent-tabs-mode: nil
40 * vim: shiftwidth=4 tabstop=8 expandtab