Fixed bug #2068: pkg-config trouble.
[yaz-moved-to-github.git] / src / atoin.c
index 1bc5947..fc40f19 100644 (file)
@@ -1,8 +1,13 @@
 /*
- * Copyright (c) 1997-2003, Index Data
+ * Copyright (C) 1995-2007, Index Data ApS
  * See the file LICENSE for details.
  *
- * $Id: atoin.c,v 1.1 2003-10-27 12:21:30 adam Exp $
+ * $Id: atoin.c,v 1.8 2007-01-03 08:42:15 adam Exp $
+ */
+
+/** 
+ * \file atoin.c
+ * \brief Implements atoi_n function.
  */
 
 #if HAVE_CONFIG_H
 
 #include <string.h>
 #include <ctype.h>
-#include <yaz/yaz-util.h>
+#include <yaz/marcdisp.h>
 
+/**
+ * atoi_n: like atoi but reads at most len characters.
+ */
 int atoi_n (const char *buf, int len)
 {
     int val = 0;
 
     while (--len >= 0)
     {
-        if (isdigit (*buf))
+        if (isdigit (*(const unsigned char *) buf))
             val = val*10 + (*buf - '0');
-       buf++;
+        buf++;
     }
     return val;
 }
 
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+