mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-01 05:07:03 +08:00
Fix warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length
This commit is contained in:
parent
0373696662
commit
554011f828
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ void jsonp_error_set_source(json_error_t *error, const char *source)
|
|||
|
||||
length = strlen(source);
|
||||
if (length < JSON_ERROR_SOURCE_LENGTH) {
|
||||
strncpy(error->source, source, length);
|
||||
strncpy(error->source, source, JSON_ERROR_SOURCE_LENGTH);
|
||||
} else {
|
||||
size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4;
|
||||
memcpy(error->source, "...", 3);
|
||||
|
|
Loading…
Reference in a new issue