aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2006-01-10 11:47:56 +0000
committerHartmut Brandt <harti@FreeBSD.org>2006-01-10 11:47:56 +0000
commite9d4cb69e22af095270655ca6faf7bd4994dadae (patch)
treef64ae349a8f9eb93e713fe699782e6f3d6ed4342 /contrib
parent361b40a30dd450a1b651f9f7e2f49a8e57cf2b8e (diff)
Notes
Diffstat (limited to 'contrib')
-rw-r--r--contrib/bsnmp/snmpd/config.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/bsnmp/snmpd/config.c b/contrib/bsnmp/snmpd/config.c
index ce3a46963a2c..0701c41280a4 100644
--- a/contrib/bsnmp/snmpd/config.c
+++ b/contrib/bsnmp/snmpd/config.c
@@ -206,17 +206,18 @@ input_open_file(const char *fname, int sysdir)
struct input *input;
FILE *fp;
char path[PATH_MAX + 1];
- char *col;
+ const char *col;
const char *ptr;
if (sysdir) {
ptr = syspath;
fp = NULL;
while (*ptr != '\0') {
- if ((col = strchr(ptr, ':')) == NULL)
+ if ((col = strchr(ptr, ':')) == NULL) {
snprintf(path, sizeof(path), "%s/%s",
ptr, fname);
- else if (col == ptr)
+ col = ptr + strlen(ptr) - 1;
+ } else if (col == ptr)
snprintf(path, sizeof(path), "./%s", fname);
else
snprintf(path, sizeof(path), "%.*s/%s",