mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-10 23:42:40 -07:00
Fix format-truncation warning, missing string.h inclusion and strnlen warning (#723)
* Fix format-truncation warning, missing string.h inclusion and strnlen warning * Dynamic string width field
This commit is contained in:
parent
6a2bd85719
commit
994f21fe01
2 changed files with 4 additions and 1 deletions
|
@ -8,11 +8,14 @@
|
|||
// asn.1 dumping
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define _POSIX_C_SOURCE 200809L // need for strnlen()
|
||||
|
||||
#include "asn1dump.h"
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <jansson.h>
|
||||
#include <mbedtls/asn1.h>
|
||||
#include <mbedtls/oid.h>
|
||||
|
|
|
@ -99,7 +99,7 @@ void PrintAndLogEx(logLevel_t level, char *fmt, ...) {
|
|||
}
|
||||
PrintAndLog(buffer2);
|
||||
} else {
|
||||
snprintf(buffer2, sizeof(buffer2), "%s%s", prefix, buffer);
|
||||
snprintf(buffer2, sizeof(buffer2), "%s%.*s", prefix, MAX_PRINT_BUFFER - 20, buffer);
|
||||
PrintAndLog(buffer2);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue