]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
dont exit() in mib.c or parse.c if mib parsing fails
authorwessels <>
Tue, 17 Mar 1998 03:32:00 +0000 (03:32 +0000)
committerwessels <>
Tue, 17 Mar 1998 03:32:00 +0000 (03:32 +0000)
snmplib/mib.c
snmplib/parse.c

index 04c0988a329739d43334f914dc80343e779abe52..31ee53b6c10a9f1191790935b091e825676f44b1 100644 (file)
@@ -698,10 +698,9 @@ int read_objid(input, output, out_len)
 
     if (root == NULL){
        snmplib_debug(0, "Mib not initialized.  Exiting.\n");
-       exit(1);
+       return 0;
     }
-    if ((*out_len =
-        parse_subtree(root, input, output, out_len)) == 0)
+    if ((*out_len = parse_subtree(root, input, output, out_len)) == 0)
        return (0);
     *out_len += output - op;
 
index 2e493530e33f169c7b81d4f2dd4a9e9afb3fbd3d..c4a66597646fd9cf43d211dc327de1343e9b4274 100644 (file)
@@ -1102,18 +1102,18 @@ read_mib(filename)
     while ( (p=fgets(mbuf, 256, fp)) && strncmp(&mbuf[4], CURRENT_MIB_VERSION,
                strlen(CURRENT_MIB_VERSION)));
     if (!p) {
-        snmplib_debug(0, "Bad MIB version or tag missing,install original!\n");
-        exit(1);
+        snmplib_debug(0, "Bad MIB version or tag missing, install original!\n");
+        return NULL;
     }
 
     if (!strcmp(mbuf, CURRENT_MIB_VERSION)) {
        snmplib_debug(0, "You need to update your MIB!\n");     
-       exit(1);
+       return NULL;
     }
     nodes = parse(fp);
     if (!nodes){
        snmplib_debug(0, "Mib table is bad.  Exiting\n");
-       exit(1);
+       return NULL;
     }
     tree = build_tree(nodes);
     fclose(fp);