]> mj.ucw.cz Git - libucw.git/blobdiff - lib/conf.c
Added generic functions for IP address access lists.
[libucw.git] / lib / conf.c
index c96d9fb304cd71e029eab9353e4abdbde4baab8f..3f79fc22d3497d4c15c9de0dc524ac7f762ebf20 100644 (file)
@@ -60,7 +60,7 @@ int cf_item_count(void)
        struct cfitem *sect, *item;
        int count = 0;
        for (sect = cfsection; sect; sect = sect->var)
-               for (item = sect+1; sect->type; sect++)
+               for (item = sect+1; item->type; item++)
                        count++;
        return count;
 }
@@ -255,13 +255,11 @@ int cf_getopt(int argc,char * const argv[],
 
                }else if(res=='C'){
                        cf_read(optarg);
-               }else if(res==-1){
+               }else{
+                       /* unhandled option or end of options */
                        if(cfdeffile)
                                cf_read(cfdeffile);
                        return res;
-               }else{  /* unhandled option */
-                       return res;
                }
        }while(1);
 }
-