/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
-/**
+/**
* \file atoin.c
* \brief Implements atoi_n function.
*/
#endif
#include <string.h>
-#include <ctype.h>
#include <yaz/marcdisp.h>
+#include <yaz/yaz-iconv.h>
int atoi_n(const char *buf, int len)
{
while (--len >= 0)
{
- if (isdigit(*(const unsigned char *) buf))
+ if (yaz_isdigit(*buf))
val = val*10 + (*buf - '0');
buf++;
}
{
int i;
for (i = 0; i < size; i++)
- if (!isdigit(i[(const unsigned char *) buf]))
+ if (!yaz_isdigit(buf[i]))
return 0;
*val = atoi_n(buf, size);
return 1;