diff --git a/src/audio.cc b/src/audio.cc index 37426da..596e3fc 100644 --- a/src/audio.cc +++ b/src/audio.cc @@ -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)) { diff --git a/src/debug.cc b/src/debug.cc index c643df7..661bf76 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -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; diff --git a/src/xfile.cc b/src/xfile.cc index 5f316dd..585f1a5 100644 --- a/src/xfile.cc +++ b/src/xfile.cc @@ -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); } }