diff --git a/kip.c b/kip.c index 733ff68..aad4623 100644 --- a/kip.c +++ b/kip.c @@ -105,9 +105,9 @@ void ini1_save(ini1_ctx_t *ctx) { } } -const char *kip1_get_json(kip1_ctx_t *ctx) { +char *kip1_get_json(kip1_ctx_t *ctx) { cJSON *kip_json = cJSON_CreateObject(); - const char *output_str = NULL; + char *output_str = NULL; char work_buffer[0x300] = {0}; /* Add KIP1 header fields. */ @@ -272,7 +272,7 @@ void kip1_save(kip1_ctx_t *ctx) { fprintf(stderr, "Failed to open %s!\n", json_path->char_path); return; } - const char *json = kip1_get_json(ctx); + char *json = kip1_get_json(ctx); if (json == NULL) { fprintf(stderr, "Failed to allocate KIP1 JSON\n"); exit(EXIT_FAILURE); diff --git a/kip.h b/kip.h index acf51a2..6edecbc 100644 --- a/kip.h +++ b/kip.h @@ -54,7 +54,7 @@ void ini1_process(ini1_ctx_t *ctx); void ini1_print(ini1_ctx_t *ctx); void ini1_save(ini1_ctx_t *ctx); -const char *kip1_get_json(kip1_ctx_t *ctx); +char *kip1_get_json(kip1_ctx_t *ctx); void kip1_process(kip1_ctx_t *ctx); void kip1_print(kip1_ctx_t *ctx, int suppress); void kip1_save(kip1_ctx_t *ctx); diff --git a/npdm.c b/npdm.c index 551b893..c46a6be 100644 --- a/npdm.c +++ b/npdm.c @@ -672,7 +672,7 @@ void npdm_save(npdm_t *npdm, hactool_ctx_t *tool_ctx) { return; } - const char *json = npdm_get_json(npdm); + char *json = npdm_get_json(npdm); if (fwrite(json, 1, strlen(json), f_json) != strlen(json)) { fprintf(stderr, "Failed to write JSON file!\n"); exit(EXIT_FAILURE); @@ -832,11 +832,11 @@ cJSON *kac_get_json(uint32_t *descriptors, uint32_t num_descriptors) { return kac_json; } -const char *npdm_get_json(npdm_t *npdm) { +char *npdm_get_json(npdm_t *npdm) { npdm_acid_t *acid = npdm_get_acid(npdm); npdm_aci0_t *aci0 = npdm_get_aci0(npdm); cJSON *npdm_json = cJSON_CreateObject(); - const char *output_str = NULL; + char *output_str = NULL; char work_buffer[0x300] = {0}; /* Add NPDM header fields. */ diff --git a/npdm.h b/npdm.h index 3c6c51e..c85645e 100644 --- a/npdm.h +++ b/npdm.h @@ -139,7 +139,7 @@ void npdm_save(npdm_t *npdm, hactool_ctx_t *tool_ctx); char *npdm_get_proc_category(int process_category); void kac_print(uint32_t *descriptors, uint32_t num_descriptors); -const char *npdm_get_json(npdm_t *npdm); +char *npdm_get_json(npdm_t *npdm); void cJSON_AddU8ToObject(cJSON *obj, char *name, uint8_t val); void cJSON_AddU16ToObject(cJSON *obj, char *name, uint16_t val);