From 40ee2838fe72c1ef59a33b132c53bea974a0fe17 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Wed, 4 Sep 2013 11:12:35 -0400 Subject: [PATCH] fix string length in snprintf for ARP table to include null byte --- tui/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tui/main.cpp b/tui/main.cpp index c9e9ba3..7836ca6 100644 --- a/tui/main.cpp +++ b/tui/main.cpp @@ -139,7 +139,7 @@ void arpMenu(WINDOW *window) { const char *arpStr = arpArray.constData(); const char *arpMacStr = arpMacArray.constData(); - snprintf(str, width + 4, formatStr, arpStr, arpMacStr); + snprintf(str, width + 5, formatStr, arpStr, arpMacStr); /*memcpy(str, arpStr, strlen(arpStr)); memcpy(str + strlen(arpStr), " at ", 4); memcpy(str + strlen(arpStr) + 4, arpMacStr, strlen(arpMacStr));*/