From 5b1804d52a13723303c290e8b4e7ce8f25f2599c Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Fri, 15 Apr 2016 10:35:58 -0700 Subject: [PATCH] Fix for JSON error reporting. (#57) Clearly upb needs more tests in its repository. Running the protobuf conformance tests against upb would be a great start... --- upb/json/parser.rl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upb/json/parser.rl b/upb/json/parser.rl index 943a490e5a..3e1ea94d25 100644 --- a/upb/json/parser.rl +++ b/upb/json/parser.rl @@ -1269,7 +1269,7 @@ size_t parse(void *closure, const void *hd, const char *buf, size_t size, %% write exec; if (p != pe) { - upb_status_seterrf(&parser->status, "Parse error at '%.*s'\n", p, pe - p); + upb_status_seterrf(&parser->status, "Parse error at '%.*s'\n", pe - p, p); upb_env_reporterror(parser->env, &parser->status); } else { capture_suspend(parser, &p);