From: wessels <> Date: Tue, 17 Mar 1998 03:32:00 +0000 (+0000) Subject: dont exit() in mib.c or parse.c if mib parsing fails X-Git-Tag: SQUID_3_0_PRE1~3832 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2bdd3f65c33f2fd39858a61820f6d1c427f363b;p=thirdparty%2Fsquid.git dont exit() in mib.c or parse.c if mib parsing fails --- diff --git a/snmplib/mib.c b/snmplib/mib.c index 04c0988a32..31ee53b6c1 100644 --- a/snmplib/mib.c +++ b/snmplib/mib.c @@ -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; diff --git a/snmplib/parse.c b/snmplib/parse.c index 2e493530e3..c4a6659764 100644 --- a/snmplib/parse.c +++ b/snmplib/parse.c @@ -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);