From 23d2e1da69a86d1d7a9e8f640d8654c1fa99cd4d Mon Sep 17 00:00:00 2001 From: maxcodehack Date: Mon, 18 Jan 2021 09:02:03 +0000 Subject: [PATCH] "Fridge" game: function PlayMusic: fix strcat memory leak and optimization fix (: "memory") git-svn-id: svn://kolibrios.org@8539 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/games/fridge/mp3.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/programs/games/fridge/mp3.h b/programs/games/fridge/mp3.h index 2da23e5d92..7837bb0173 100755 --- a/programs/games/fridge/mp3.h +++ b/programs/games/fridge/mp3.h @@ -1,7 +1,4 @@ -// !!!!!!! -// -O0 -// (optimization 0) -// !!!!!!! +// Was written by maxcodehack #pragma pack(push,1) typedef struct @@ -18,7 +15,7 @@ char *p21; int kol_file_70(kol_struct70 *k) { - asm volatile ("int $0x40"::"a"(70), "b"(k)); + __asm__ __volatile__ ("int $0x40"::"a"(70), "b"(k) : "memory"); } int RunApp(char *app, char *param) @@ -36,7 +33,7 @@ int RunApp(char *app, char *param) void PlayMusic(char name[]) { - char param[] = "-h "; + char param[256] = "-h "; strcat(param, name); RunApp("/sys/media/ac97snd", param); };