-/* $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>
lastupdated : LASTUPDATED TEXT {
char timebuf[14] = "";
- struct tm tm;
+ struct tm tm = {};
size_t len;
if ((len = strlen($2)) == 11)
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;
}