Support compilation in WSL Ubuntu 20.04 LTS. Fix some warnings.

This commit is contained in:
Sorgelig
2021-10-07 03:08:56 +08:00
parent a215fb36bb
commit 7abbf7f8f4
12 changed files with 37 additions and 40 deletions

View File

@@ -179,7 +179,7 @@ static const char *get_arcade_root(int rbf)
static char path[kBigTextSize];
if (!rbf) strcpy(path, mame_root);
else sprintf(path, "%s/cores", arcade_root);
else snprintf(path, sizeof(path), "%s/cores", arcade_root);
return path;
}
@@ -1149,7 +1149,7 @@ static const char *get_rbf(const char *xml)
}
}
if (lastfound[0]) sprintf(rbfname, "%s/%s", dirname, lastfound);
if (lastfound[0]) snprintf(rbfname, sizeof(rbfname), "%s/%s", dirname, lastfound);
closedir(dir);
return lastfound[0] ? rbfname : NULL;
@@ -1161,7 +1161,7 @@ int arcade_load(const char *xml)
static char path[kBigTextSize];
if(xml[0] == '/') strcpy(path, xml);
else sprintf(path, "%s/%s", getRootDir(), xml);
else snprintf(path, sizeof(path), "%s/%s", getRootDir(), xml);
set_arcade_root(path);
printf("arcade_load [%s]\n", path);