mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
remove a warning
This commit is contained in:
parent
8512c0ea09
commit
01cf818e48
1 changed files with 7 additions and 9 deletions
|
@ -3,8 +3,7 @@
|
||||||
|
|
||||||
void jsonp_error_init(json_error_t *error, const char *source)
|
void jsonp_error_init(json_error_t *error, const char *source)
|
||||||
{
|
{
|
||||||
if(error)
|
if (error) {
|
||||||
{
|
|
||||||
error->text[0] = '\0';
|
error->text[0] = '\0';
|
||||||
error->line = -1;
|
error->line = -1;
|
||||||
error->column = -1;
|
error->column = -1;
|
||||||
|
@ -24,9 +23,9 @@ void jsonp_error_set_source(json_error_t *error, const char *source)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
length = strlen(source);
|
length = strlen(source);
|
||||||
if(length < JSON_ERROR_SOURCE_LENGTH)
|
if (length < JSON_ERROR_SOURCE_LENGTH) {
|
||||||
strncpy(error->source, source, JSON_ERROR_SOURCE_LENGTH);
|
strncpy(error->source, source, length);
|
||||||
else {
|
} else {
|
||||||
size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4;
|
size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4;
|
||||||
memcpy(error->source, "...", 3);
|
memcpy(error->source, "...", 3);
|
||||||
strncpy(error->source + 3, source + extra, length - extra + 1);
|
strncpy(error->source + 3, source + extra, length - extra + 1);
|
||||||
|
@ -38,7 +37,6 @@ void jsonp_error_set(json_error_t *error, int line, int column,
|
||||||
const char *msg, ...)
|
const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
va_start(ap, msg);
|
va_start(ap, msg);
|
||||||
jsonp_error_vset(error, line, column, position, code, msg, ap);
|
jsonp_error_vset(error, line, column, position, code, msg, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue