mirror of
https://github.com/libretro/RetroArch
synced 2024-12-26 03:22:56 +00:00
Remove dependency on strlcpy for rjson.c
This commit is contained in:
parent
8074a833aa
commit
83a187784a
@ -107,12 +107,9 @@ static enum rjson_type _rjson_error_char(rjson_t *json,
|
|||||||
char buf[16];
|
char buf[16];
|
||||||
if (json->stack_top->type == RJSON_ERROR)
|
if (json->stack_top->type == RJSON_ERROR)
|
||||||
return RJSON_ERROR;
|
return RJSON_ERROR;
|
||||||
if (chr == _rJSON_EOF)
|
snprintf(buf, sizeof(buf),
|
||||||
strlcpy(buf, "end of stream", sizeof(buf));
|
(chr == _rJSON_EOF ? "end of stream" :
|
||||||
else if (chr >= ' ' && chr <= '~')
|
(chr >= ' ' && chr <= '~' ? "'%c'" : "byte 0x%02X")), chr);
|
||||||
snprintf(buf, sizeof(buf), "'%c'", chr);
|
|
||||||
else
|
|
||||||
snprintf(buf, sizeof(buf), "byte 0x%02X", chr);
|
|
||||||
return _rjson_error(json, fmt, buf);
|
return _rjson_error(json, fmt, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user