From 2b2767017c0214618caf201d51c11fa8c56b7075 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 17 Sep 2015 10:14:57 +0200 Subject: [PATCH] (platform_linux.c) CXX_BUILD fix --- frontend/drivers/platform_linux.c | 7 +++---- libretro-db/libretrodb.c | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/drivers/platform_linux.c b/frontend/drivers/platform_linux.c index 52207633bd..7a951e4c7e 100644 --- a/frontend/drivers/platform_linux.c +++ b/frontend/drivers/platform_linux.c @@ -245,7 +245,6 @@ typedef struct */ static void cpulist_parse(CpuList* list, const char* line, int line_len) { - const char* q; const char* p = line; const char* end = p + line_len; @@ -255,10 +254,10 @@ static void cpulist_parse(CpuList* list, const char* line, int line_len) while (p < end && *p != '\n') { int val, start_value, end_value; - /* Find the end of current item, and put it into 'q' */ - q = memchr(p, ',', end-p); - if (q == NULL) + const char *q = (const char*)memchr(p, ',', end-p); + + if (!q) q = end; /* Get first value */ diff --git a/libretro-db/libretrodb.c b/libretro-db/libretrodb.c index 7c27fbf5e7..f416e6c6fb 100644 --- a/libretro-db/libretrodb.c +++ b/libretro-db/libretrodb.c @@ -224,6 +224,7 @@ int libretrodb_open(const char *path, libretrodb_t *db) db->first_index_offset = lseek(fd, 0, SEEK_CUR); db->fd = fd; return 0; + error: close(fd); return rv;