From 5e339c89753c2b3367e63e1d79b70701ec249756 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 18 May 2025 12:17:53 +1000 Subject: [PATCH] dep/rcheevos: Fix buffer reserve estimate --- dep/rcheevos/src/rapi/rc_api_info.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dep/rcheevos/src/rapi/rc_api_info.c b/dep/rcheevos/src/rapi/rc_api_info.c index f9d4642b7..84423ae0e 100644 --- a/dep/rcheevos/src/rapi/rc_api_info.c +++ b/dep/rcheevos/src/rapi/rc_api_info.c @@ -550,7 +550,7 @@ int rc_api_process_fetch_hash_library_server_response(rc_api_fetch_hash_library_ response->num_entries = fields[2].array_size; if (response->num_entries > 0) { - rc_buffer_reserve(&response->response.buffer, response->num_entries * (32 + sizeof(rc_api_hash_library_entry_t))); + rc_buffer_reserve(&response->response.buffer, response->num_entries * (33 + sizeof(rc_api_hash_library_entry_t))); response->entries = (rc_api_hash_library_entry_t*)rc_buffer_alloc( &response->response.buffer, response->num_entries * sizeof(rc_api_hash_library_entry_t)); @@ -563,7 +563,6 @@ int rc_api_process_fetch_hash_library_server_response(rc_api_fetch_hash_library_ entry = response->entries; while (rc_json_get_next_object_field(&iterator, &field)) { - /* TODO: This isn't handling escape characters in the key, the RC JSON parsing functions have no method for it. */ entry->hash = rc_buffer_strncpy(&response->response.buffer, field.name, field.name_len); field.name = "";