summaryrefslogtreecommitdiffstats
path: root/contrib/bsnmp/gensnmptree/gensnmptree.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2005-02-28 17:27:11 +0000
committerharti <harti@FreeBSD.org>2005-02-28 17:27:11 +0000
commit273b7adb85a03a00c3b173831af21c60e5d77eb0 (patch)
treea51b475bc2677600ec8246577e5ea721c041a42d /contrib/bsnmp/gensnmptree/gensnmptree.c
parent3a13f9df8e23f636a28dcd8d08fb4ace5d70eb57 (diff)
downloadFreeBSD-src-273b7adb85a03a00c3b173831af21c60e5d77eb0.zip
FreeBSD-src-273b7adb85a03a00c3b173831af21c60e5d77eb0.tar.gz
Virgin import of bsnmpd 1.8
Diffstat (limited to 'contrib/bsnmp/gensnmptree/gensnmptree.c')
-rw-r--r--contrib/bsnmp/gensnmptree/gensnmptree.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/bsnmp/gensnmptree/gensnmptree.c b/contrib/bsnmp/gensnmptree/gensnmptree.c
index d3b9909..3b2e2c0 100644
--- a/contrib/bsnmp/gensnmptree/gensnmptree.c
+++ b/contrib/bsnmp/gensnmptree/gensnmptree.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.38 2004/08/06 08:46:46 brandt Exp $
+ * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.41 2005/02/25 11:51:12 brandt_h Exp $
*
* Generate OID table from table description.
*
@@ -50,7 +50,7 @@
*
* elements := EMPTY | elements element
*
- * element := tree | leaf
+ * element := tree | leaf | column
*
* index := TYPE | index TYPE
*
@@ -560,9 +560,12 @@ gen_header(struct node *np, u_int oidlen, const char *func)
if((np->flags & (FL_GET|FL_SET)) == 0)
return;
- if (np->type == NODE_COLUMN)
+ if (np->type == NODE_COLUMN) {
+ if (func == NULL)
+ errx(1, "column without function (%s) - probably "
+ "outside of a table", np->name);
sprintf(f, "%s", func);
- else
+ } else
sprintf(f, "%s", np->u.leaf.func);
LIST_FOREACH(ptr, &funcs, link)
OpenPOWER on IntegriCloud