]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - lib/snmplib/mib.c
SourceFormat Enforcement
[thirdparty/squid.git] / lib / snmplib / mib.c
index 707f307f7aa28ef83d8bf7b91013fe3b9559e813..282f747516474d2c8bee10f6ab056f3f83174f15 100644 (file)
@@ -1,6 +1,13 @@
+/*
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
 
 /***********************************************************
-       Copyright 1988, 1989 by Carnegie Mellon University
+    Copyright 1988, 1989 by Carnegie Mellon University
 
                       All Rights Reserved
 
@@ -21,11 +28,8 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 SOFTWARE.
 ******************************************************************/
 
-#define SQUID_NO_STRING_BUFFER_PROTECT 1
 #include "squid.h"
 
-#include <stdio.h>
-
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -225,7 +229,7 @@ int
 read_objid(input, output, out_len)
 char *input;
 oid *output;
-int *out_len;          /* number of subid's in "output" */
+int *out_len;       /* number of subid's in "output" */
 {
     struct snmp_mib_tree *root = Mib;
     oid *op = output;
@@ -259,12 +263,12 @@ int *out_len;             /* number of subid's in "output" */
 void
 print_objid(objid, objidlen)
 oid *objid;
-int objidlen;          /* number of subidentifiers */
+int objidlen;       /* number of subidentifiers */
 {
     char buf[256];
     struct snmp_mib_tree *subtree = Mib;
 
-    *buf = '.';                        /* this is a fully qualified name */
+    *buf = '.';         /* this is a fully qualified name */
     get_symbol(objid, objidlen, subtree, buf + 1);
     snmplib_debug(7, "%s\n", buf);
 
@@ -274,11 +278,11 @@ void
 sprint_objid(buf, objid, objidlen)
 char *buf;
 oid *objid;
-int objidlen;          /* number of subidentifiers */
+int objidlen;       /* number of subidentifiers */
 {
     struct snmp_mib_tree *subtree = Mib;
 
-    *buf = '.';                        /* this is a fully qualified name */
+    *buf = '.';         /* this is a fully qualified name */
     get_symbol(objid, objidlen, subtree, buf + 1);
 }
 
@@ -299,12 +303,12 @@ char *buf;
     }
 
     /* subtree not found */
-    while (objidlen--) {       /* output rest of name, uninterpreted */
+    while (objidlen--) {    /* output rest of name, uninterpreted */
         sprintf(buf, "%u.", *objid++);
         while (*buf)
             buf++;
     }
-    *(buf - 1) = '\0';         /* remove trailing dot */
+    *(buf - 1) = '\0';      /* remove trailing dot */
     return NULL;
 
 found:
@@ -329,3 +333,4 @@ print_oid_nums(oid * O, int len)
     for (x = 0; x < len; x++)
         printf(".%u", O[x]);
 }
+