28 chars fix

This commit is contained in:
Fl0-0 2018-09-22 17:15:34 +02:00
commit 2baf9ddc57

View file

@ -89,7 +89,7 @@ static void error_set(json_error_t *error, const lex_t *lex,
{ {
va_list ap; va_list ap;
char msg_text[JSON_ERROR_TEXT_LENGTH]; char msg_text[JSON_ERROR_TEXT_LENGTH];
char msg_with_context[JSON_ERROR_TEXT_LENGTH + 17]; char msg_with_context[JSON_ERROR_TEXT_LENGTH + 28];
int line = -1, col = -1; int line = -1, col = -1;
size_t pos = 0; size_t pos = 0;
@ -114,7 +114,7 @@ static void error_set(json_error_t *error, const lex_t *lex,
if(saved_text && saved_text[0]) if(saved_text && saved_text[0])
{ {
if(lex->saved_text.length <= 20) { if(lex->saved_text.length <= 20) {
snprintf(msg_with_context, JSON_ERROR_TEXT_LENGTH + 8, snprintf(msg_with_context, JSON_ERROR_TEXT_LENGTH + 28,
"%s near '%s'", msg_text, saved_text); "%s near '%s'", msg_text, saved_text);
msg_with_context[JSON_ERROR_TEXT_LENGTH - 1] = '\0'; msg_with_context[JSON_ERROR_TEXT_LENGTH - 1] = '\0';
result = msg_with_context; result = msg_with_context;