diff --git a/include/rjp.h b/include/rjp.h index c73acaa..2f5f95b 100644 --- a/include/rjp.h +++ b/include/rjp.h @@ -130,7 +130,7 @@ RJP_value* rjp_parse(const char* str, int flags, RJP_parse_error* err); RJP_value* rjp_parse_cback(int flags, RJP_parse_callback* cbacks, RJP_parse_error* err); char* rjp_to_json(const RJP_value* root, int pretty); -char* rjp_parse_error_to_string(RJP_parse_error* err); +char* rjp_parse_error_to_string(const RJP_parse_error* err); void rjp_delete_parse_error(RJP_parse_error* err); RJP_value* rjp_new_null(void); diff --git a/src/rjp_parse.c b/src/rjp_parse.c index 940c249..54af75f 100644 --- a/src/rjp_parse.c +++ b/src/rjp_parse.c @@ -317,8 +317,8 @@ static int irjp_parse_cback(RJP_parse_state* state, RJP_parse_callback* cback){ return irjp_handle_final_parse_token(state, cat); } -char* rjp_parse_error_to_string(RJP_parse_error* err){ - RJP_parse_state* state = (RJP_parse_state*)err->parsestate; +char* rjp_parse_error_to_string(const RJP_parse_error* err){ + const RJP_parse_state* state = (const RJP_parse_state*)err->parsestate; RJP_parse_status status = err->errcode; char* buffer = NULL; const char* format = NULL;