X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/556826b5d52152450259311c613695ee5adcac04..17505ce2a74468c89747c996a72139aa9f3ca225:/client/jansson/error.c?ds=sidebyside diff --git a/client/jansson/error.c b/client/jansson/error.c index cbd50d7e..b94b3a3a 100644 --- a/client/jansson/error.c +++ b/client/jansson/error.c @@ -25,10 +25,10 @@ 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 + 1); + strncpy(error->source, source, JSON_ERROR_SOURCE_LENGTH); else { size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4; - strncpy(error->source, "...", 3); + memcpy(error->source, "...", 3); strncpy(error->source + 3, source + extra, length - extra + 1); } }