"Fridge" game: function PlayMusic: fix strcat memory leak and optimization fix (: "memory")

git-svn-id: svn://kolibrios.org@8539 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
maxcodehack 2021-01-18 09:02:03 +00:00
parent 59994f2adb
commit 23d2e1da69

View File

@ -1,7 +1,4 @@
// !!!!!!! // Was written by maxcodehack
// -O0
// (optimization 0)
// !!!!!!!
#pragma pack(push,1) #pragma pack(push,1)
typedef struct typedef struct
@ -18,7 +15,7 @@ char *p21;
int kol_file_70(kol_struct70 *k) 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) int RunApp(char *app, char *param)
@ -36,7 +33,7 @@ int RunApp(char *app, char *param)
void PlayMusic(char name[]) { void PlayMusic(char name[]) {
char param[] = "-h "; char param[256] = "-h ";
strcat(param, name); strcat(param, name);
RunApp("/sys/media/ac97snd", param); RunApp("/sys/media/ac97snd", param);
}; };