Jansson gcc8 fix (#679)

* Fix error in error.c
* Fix error in load.c
This commit is contained in:
Fl0-0 2018-09-22 17:51:13 +02:00 committed by pwpiwi
parent 050aa18b13
commit a7e1b46d51
2 changed files with 5 additions and 5 deletions

View file

@ -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);
}
}