X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/654b6ae3f4bf56bc210022b603edbb1575e05dff..a334de73d264b10fd9d9da5b752231cf521a6ce7:/client/jansson/error.c 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); } }