From a309b9e772d4de38affc0aa43e965360afa2906b Mon Sep 17 00:00:00 2001 From: rexy712 Date: Thu, 9 Apr 2020 03:12:37 -0700 Subject: [PATCH] Fix clang warnings --- src/rjp_parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rjp_parse.c b/src/rjp_parse.c index 5776617..940c249 100644 --- a/src/rjp_parse.c +++ b/src/rjp_parse.c @@ -340,8 +340,8 @@ char* rjp_parse_error_to_string(RJP_parse_error* err){ break; case RJP_PARSE_STATUS_NO_ROOT_VALUE: format = "Missing root JSON value"; - buffer = rjp_alloc(snprintf(NULL, 0, format) + 1); - sprintf(buffer, format); + buffer = rjp_alloc(snprintf(NULL, 0, "%s", format) + 1); + sprintf(buffer, "%s", format); break; case RJP_PARSE_STATUS_MISSING_KEY: format = "Expected key before '%.*s'"; @@ -355,13 +355,13 @@ char* rjp_parse_error_to_string(RJP_parse_error* err){ break; case RJP_PARSE_STATUS_EXCESS_DATA: format = "Excess data after JSON"; - buffer = rjp_alloc(snprintf(NULL, 0, format) + 1); - sprintf(buffer, format); + buffer = rjp_alloc(snprintf(NULL, 0, "%s", format) + 1); + sprintf(buffer, "%s", format); break; case RJP_PARSE_STATUS_MISSING_CLOSE_BRACE: format = "Missing closing brace"; - buffer = rjp_alloc(snprintf(NULL, 0, format) + 1); - sprintf(buffer, format); + buffer = rjp_alloc(snprintf(NULL, 0, "%s", format) + 1); + sprintf(buffer, "%s", format); break; default: break;