From 77b1421500767461190d8833b8ee8116b2122f0c Mon Sep 17 00:00:00 2001 From: Alcaro Date: Sat, 26 Nov 2016 20:27:13 +0100 Subject: [PATCH] Avoid copying unneeded bytes --- cheevos.c | 9 +-------- frontend/drivers/platform_win32.c | 1 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cheevos.c b/cheevos.c index 912f42d70e..a952c3d6f6 100644 --- a/cheevos.c +++ b/cheevos.c @@ -461,13 +461,6 @@ static void cheevos_log_cond(const cheevos_cond_t* cond) static void cheevos_log_cheevo(const cheevo_t* cheevo, const cheevos_field_t* memaddr_ud) { - char memaddr[256]; - - strlcpy(memaddr, memaddr_ud->string, sizeof(memaddr)); - - if (memaddr_ud->length < sizeof(memaddr)) - memaddr[memaddr_ud->length] = 0; - RARCH_LOG("CHEEVOS cheevo %p\n", cheevo); RARCH_LOG("CHEEVOS id: %u\n", cheevo->id); RARCH_LOG("CHEEVOS title: %s\n", cheevo->title); @@ -476,7 +469,7 @@ static void cheevos_log_cheevo(const cheevo_t* cheevo, RARCH_LOG("CHEEVOS badge: %s\n", cheevo->badge); RARCH_LOG("CHEEVOS points: %u\n", cheevo->points); RARCH_LOG("CHEEVOS sets: TBD\n"); - RARCH_LOG("CHEEVOS memaddr: %s\n", memaddr); + RARCH_LOG("CHEEVOS memaddr: %s\n", memaddr_ud->string); } static void cheevos_add_var_size(char** aux, size_t* left, diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index c5e08c7270..0efdd53d69 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -168,6 +168,7 @@ static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor) } break; default: + sprintf(s, "Windows %i.%i", *major, *minor); break; } }