FIX: gcc8.1 warnings

This commit is contained in:
iceman1001
2019-01-09 16:25:49 +01:00
parent 96361abd97
commit e276bf1ce3
5 changed files with 59 additions and 36 deletions

View File

@@ -24,7 +24,9 @@
#include "util.h"
#include "proxmark3.h"
#define PRINT_INDENT(level) {for (int i = 0; i < (level); i++) fprintf(f, " ");}
#ifndef PRINT_INDENT
# define PRINT_INDENT(level) {for (int i = 0; i < (level); i++) fprintf(f, " ");}
#endif
enum asn1_tag_t {
ASN1_TAG_GENERIC,

View File

@@ -371,7 +371,6 @@ bool ParamLoadFromJson(struct tlvdb *tlv) {
uint8_t buf[251] = {0};
size_t buflen = 0;
// here max length must be 4, but now tlv_tag_t is 2-byte var. so let it be 2 by now... TODO: needs refactoring tlv_tag_t...
if (!HexToBuffer("TLV Error type:", tlvTag, buf, 4, &buflen)) {
json_decref(root);
return false;

View File

@@ -212,7 +212,7 @@ void print_hex_break(const uint8_t *data, const size_t len, uint8_t breaks) {
}
char *sprint_hex(const uint8_t *data, const size_t len) {
static char buf[UTIL_BUFFER_SIZE_SPRINT] = {0};
static char buf[UTIL_BUFFER_SIZE_SPRINT - 3] = {0};
hex_to_buffer((uint8_t *)buf, data, len, sizeof(buf) - 1, 0, 1, true);
return buf;
}