X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcd%2Fcd_image.c;h=5638c9be0dd030e3d658314a1d265df1b891d0ff;hb=d0eab7dae887dd75a33cfbb4c5a60f535d7fece3;hp=97c8f3f0254f8952ccade84c3fb35179a7745a72;hpb=274fcc35aa20e9777a8e09630a94088757384329;p=picodrive.git diff --git a/pico/cd/cd_image.c b/pico/cd/cd_image.c index 97c8f3f..5638c9b 100644 --- a/pico/cd/cd_image.c +++ b/pico/cd/cd_image.c @@ -11,6 +11,10 @@ #include "cdd.h" #include "cue.h" +#if defined(__GNUC__) && __GNUC__ >= 7 +#pragma GCC diagnostic ignored "-Wformat-truncation" +#endif + static int handle_mp3(const char *fname, int index) { track_t *track = &cdd.toc.tracks[index]; @@ -61,6 +65,7 @@ static void to_upper(char *d, const char *s) else *d = *s; } + *d = 0; } // cdd.c uses lba - 150 @@ -183,7 +188,6 @@ int load_cd_image(const char *cd_img_name, int *type) elprintf(EL_STATUS, "Track %2i: %s %9i AUDIO %s", n, tmp_ext, length, cue_data->tracks[n].fname); } - cue_destroy(cue_data); goto finish; } @@ -260,6 +264,9 @@ finish: if (PicoCDLoadProgressCB != NULL) PicoCDLoadProgressCB(cd_img_name, 100); + if (cue_data != NULL) + cue_destroy(cue_data); + return 0; }