Fix some sprintf warnings

This commit is contained in:
Alexander Batalov 2022-07-06 14:12:48 +03:00
parent 28a379d1d4
commit c1e89205ed
3 changed files with 6 additions and 6 deletions

View File

@ -44,7 +44,7 @@ static int audioSoundDecoderReadHandler(int fileHandle, void* buffer, unsigned i
int audioOpen(const char* fname, int flags, ...)
{
char path[80];
sprintf(path, fname);
sprintf(path, "%s", fname);
int compression;
if (_queryCompressedFunc(path)) {

View File

@ -197,7 +197,7 @@ static int _debug_log(char* string)
return -1;
}
if (fprintf(_fd, string) < 0) {
if (fprintf(_fd, "%s", string) < 0) {
return -1;
}
@ -213,7 +213,7 @@ static int _debug_log(char* string)
static int _debug_screen(char* string)
{
if (gDebugPrintProc == _debug_screen) {
printf(string);
printf("%s", string);
}
return 0;

View File

@ -92,7 +92,7 @@ XFile* xfileOpen(const char* filePath, const char* mode)
}
stream->type = XFILE_TYPE_FILE;
sprintf(path, filePath);
sprintf(path, "%s", filePath);
} else {
// [filePath] is a relative path. Loop thru open xbases and attempt to
// open [filePath] from appropriate xbase.
@ -103,7 +103,7 @@ XFile* xfileOpen(const char* filePath, const char* mode)
stream->dfile = dfileOpen(curr->dbase, filePath, mode);
if (stream->dfile != NULL) {
stream->type = XFILE_TYPE_DFILE;
sprintf(path, filePath);
sprintf(path, "%s", filePath);
break;
}
} else {
@ -130,7 +130,7 @@ XFile* xfileOpen(const char* filePath, const char* mode)
}
stream->type = XFILE_TYPE_FILE;
sprintf(path, filePath);
sprintf(path, "%s", filePath);
}
}