yaz_poll: Allow num_fds == 0
[yaz-moved-to-github.git] / src / readconf.c
index 6497ff6..b293ff6 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
 
@@ -13,7 +13,6 @@
 #endif
 
 #include <stdio.h>
-#include <ctype.h>
 
 #include <yaz/log.h>
 #include <yaz/readconf.h>
@@ -37,7 +36,7 @@ int readconf_line(FILE *f, int *lineno, char *line, int len,
     if (!p)
         return 0;
     
-    for (argc = 0; *p ; argc++)
+    for (argc = 0; *p && argc < num ; argc++)
     {
         if (*p == '#')  /* trailing comment */
             break;