From: David Date: Tue, 24 Nov 2015 12:49:31 +0000 (+0100) Subject: Fix the lprintf method (libretro side) X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd7b09f4f98effa884fb282329cd55e891f12c22;p=picodrive.git Fix the lprintf method (libretro side) The lprintf method used the format string instead of the buffer build from va_list --- diff --git a/pico/media.c b/pico/media.c index 3ba45324..b7fa7f56 100644 --- a/pico/media.c +++ b/pico/media.c @@ -244,7 +244,7 @@ enum media_type_e PicoLoadMedia(const char *filename, rom = pm_open(rom_fname); if (rom == NULL) { - lprintf("Failed to open ROM"); + lprintf("Failed to open ROM\n"); media_type = PM_ERROR; goto out; } @@ -252,9 +252,9 @@ enum media_type_e PicoLoadMedia(const char *filename, ret = PicoCartLoad(rom, &rom_data, &rom_size, (PicoAHW & PAHW_SMS) ? 1 : 0); pm_close(rom); if (ret != 0) { - if (ret == 2) lprintf("Out of memory"); - else if (ret == 3) lprintf("Read failed"); - else lprintf("PicoCartLoad() failed."); + if (ret == 2) lprintf("Out of memory\n"); + else if (ret == 3) lprintf("Read failed\n"); + else lprintf("PicoCartLoad() failed.\n"); media_type = PM_ERROR; goto out; } diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 61d6f7b7..799ff8d4 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -469,7 +469,7 @@ void lprintf(const char *fmt, ...) vsprintf(buffer, fmt, ap); /* TODO - add 'level' param for warning/error messages? */ if (log_cb) - log_cb(RETRO_LOG_INFO, "%s\n", fmt, ap); + log_cb(RETRO_LOG_INFO, "%s", buffer); va_end(ap); }