summaryrefslogtreecommitdiff
path: root/usr.bin/snmp
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2019-08-13 12:28:04 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2019-08-13 12:28:04 +0000
commitc31e88d34dad3410a03f6f3f0cb8f88bd1c4ba41 (patch)
treea9ffbef4c064ca1aed547a03b4adf545c3bd9034 /usr.bin/snmp
parent7bcb7a574555832aadc99cf89077980f8b32be94 (diff)
Error-index starts at 1, not 0.
Diffstat (limited to 'usr.bin/snmp')
-rw-r--r--usr.bin/snmp/snmpc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/snmp/snmpc.c b/usr.bin/snmp/snmpc.c
index b0df7f7bdc2..162b7a440ca 100644
--- a/usr.bin/snmp/snmpc.c
+++ b/usr.bin/snmp/snmpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpc.c,v 1.5 2019/08/11 18:11:10 martijn Exp $ */
+/* $OpenBSD: snmpc.c,v 1.6 2019/08/13 12:28:03 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
@@ -343,7 +343,7 @@ snmpc_get(int argc, char *argv[])
&varbind);
if (errorstatus != 0)
snmpc_printerror((enum snmp_error) errorstatus,
- argv[errorindex]);
+ argv[errorindex - 1]);
for (; varbind != NULL; varbind = varbind->be_next) {
if (!snmpc_print(varbind))
@@ -394,7 +394,7 @@ snmpc_walk(int argc, char *argv[])
&errorindex, &varbind);
if (errorstatus != 0)
snmpc_printerror((enum snmp_error) errorstatus,
- argv[errorindex]);
+ argv[errorindex - 1]);
if (!snmpc_print(varbind))
err(1, "Can't print response");
@@ -451,7 +451,7 @@ snmpc_walk(int argc, char *argv[])
&errorindex, &varbind);
if (errorstatus != 0)
snmpc_printerror((enum snmp_error) errorstatus,
- argv[errorindex]);
+ argv[errorindex - 1]);
if (!snmpc_print(varbind))
err(1, "Can't print response");