summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/mib.y
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/snmpd/mib.y')
-rw-r--r--usr.sbin/snmpd/mib.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/snmpd/mib.y b/usr.sbin/snmpd/mib.y
index 5e18dbecc3b..ae33b64280f 100644
--- a/usr.sbin/snmpd/mib.y
+++ b/usr.sbin/snmpd/mib.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: mib.y,v 1.1 2024/01/27 09:53:59 martijn Exp $ */
+/* $OpenBSD: mib.y,v 1.2 2024/02/20 12:41:13 martijn Exp $ */
/*
* Copyright (c) 2023 Martijn van Duren <martijn@openbsd.org>
@@ -496,7 +496,7 @@ moduleidentity : descriptor MODULEIDENTITY lastupdated
lastupdated : LASTUPDATED TEXT {
char timebuf[14] = "";
- struct tm tm;
+ struct tm tm = {};
size_t len;
if ((len = strlen($2)) == 11)
@@ -505,11 +505,11 @@ lastupdated : LASTUPDATED TEXT {
else if (len == 13)
strlcpy(timebuf, $2, sizeof(timebuf));
else {
- yyerror("Invalid LAST-UPDATED");
+ yyerror("Invalid LAST-UPDATED: %s", $2);
YYERROR;
}
- if (strptime(timebuf, "%Y%M%d%H%MZ", &tm) == NULL) {
+ if (strptime(timebuf, "%Y%m%d%H%MZ", &tm) == NULL) {
yyerror("Invalid LAST-UPDATED: %s", $2);
YYERROR;
}