* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
void log_ref_display(struct vty *vty, uint32_t code, bool json)
{
struct log_ref *ref;
- struct json_object *top, *obj;
+ struct json_object *top = NULL, *obj = NULL;
struct list *errlist;
struct listnode *ln;
snprintf(pbuf, sizeof(pbuf), "\nError %"PRIu32" - %s",
ref->code, ref->title);
memset(ubuf, '=', strlen(pbuf));
- ubuf[sizeof(ubuf) - 1] = '\0';
+ ubuf[strlen(pbuf)] = '\0';
vty_out(vty, "%s\n%s\n", pbuf, ubuf);
vty_out(vty, "Description:\n%s\n\n", ref->description);