diff --git a/src/error.c b/src/error.c index 14d0047d..70b62042 100644 --- a/src/error.c +++ b/src/error.c @@ -22,7 +22,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 + 1); + strncpy(error->source, source, JSON_ERROR_SOURCE_LENGTH); else { size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4; memcpy(error->source, "...", 3);