forked from KolibriOS/kolibrios
"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:
parent
59994f2adb
commit
23d2e1da69
@ -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);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user