From: marshmellow42 Date: Sun, 14 Feb 2016 23:08:14 +0000 (-0500) Subject: clear array before assigning X-Git-Tag: v2.3.0~7^2~1 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/d0168f2f4919562e94b22215a182622bca2e2785 clear array before assigning --- diff --git a/client/cmdmain.c b/client/cmdmain.c index 7bba80f4..c1d730ee 100644 --- a/client/cmdmain.c +++ b/client/cmdmain.c @@ -177,10 +177,11 @@ void UsbCommandReceived(UsbCommand *UC) switch(UC->cmd) { // First check if we are handling a debug message case CMD_DEBUG_PRINT_STRING: { - char s[USB_CMD_DATA_SIZE+1] = {0x00}; + char s[USB_CMD_DATA_SIZE+1]; + memset(s, 0x00, sizeof(s)); size_t len = MIN(UC->arg[0],USB_CMD_DATA_SIZE); memcpy(s,UC->d.asBytes,len); - PrintAndLog("#db# %s ", s); + PrintAndLog("#db# %s", s); return; } break;