--- scorched.orig/src/3dsparse/ModelID.cpp 2003-11-26 17:14:27.000000000 -0500 +++ scorched.orig/src/3dsparse/ModelID.cpp 2004-01-25 15:51:52.000000000 -0500 @@ -27,7 +27,7 @@ static const char *getDirectoryPath(const char *file) { static char buffer[256]; - sprintf(buffer, PKGDIR "%s", file); + snprintf(buffer, sizeof(buffer), "%s%s", PKGDIR, file); return buffer; } @@ -80,11 +80,11 @@ bool ModelID::initFromNode(const char *d const char *skinNameContent = skinNode->getContent(); static char skinName[1024]; - sprintf(skinName, "%s/%s", directory, skinNameContent); + snprintf(skinName, sizeof(skinName), "%s/%s", directory, skinNameContent); const char *meshNameContent = meshNode->getContent(); static char meshName[1024]; - sprintf(meshName, "%s/%s", directory, meshNameContent); + snprintf(meshName, sizeof(meshName), "%s/%s", directory, meshNameContent); if (!::wxFileExists(getDirectoryPath(skinName))) { @@ -108,7 +108,7 @@ bool ModelID::initFromNode(const char *d { const char *meshNameContent = modelNode->getContent(); static char meshName[1024]; - sprintf(meshName, "%s/%s", directory, meshNameContent); + snprintf(meshName, sizeof(meshName),"%s/%s", directory, meshNameContent); if (!::wxFileExists(getDirectoryPath(meshName))) { --- scorched.orig/src/GLEXT/GLConsole.cpp 2003-12-08 18:08:58.000000000 -0500 +++ scorched.orig/src/GLEXT/GLConsole.cpp 2004-01-25 04:12:55.000000000 -0500 @@ -231,7 +231,7 @@ void GLConsole::addLine(bool parse, cons va_list ap; va_start(ap, fmt); - vsprintf(text, fmt, ap); + vsnprintf(text, sizeof(text), fmt, ap); va_end(ap); DIALOG_ASSERT(strlen(text)setNewPercentage(float (i) / 16.0f * 100.0f); char buffer[100]; - sprintf(buffer, PKGDIR "data/textures/lensflare/shine%d.bw", i); + snprintf(buffer, sizeof(buffer), "%sdata/textures/lensflare/shine%d.bw", PKGDIR, i); GLLuminance bitmap(buffer); shines_[i].create(bitmap, GL_LUMINANCE); @@ -114,7 +114,7 @@ void GLLenseFlare::init(ProgressCounter if (counter) counter->setNewPercentage(float (i+10) / 16.0f * 100.0f); char buffer[100]; - sprintf(buffer , PKGDIR "data/textures/lensflare/flare%d.bw", i); + snprintf(buffer , "%sdata/textures/lensflare/flare%d.bw", PKGDIR, i); GLLuminance bitmap(buffer); flares_[i].create(bitmap, GL_LUMINANCE); --- scorched.orig/src/GLW/GLWListView.cpp 2003-11-16 18:19:56.000000000 -0500 +++ scorched.orig/src/GLW/GLWListView.cpp 2004-01-25 14:42:46.000000000 -0500 @@ -101,7 +101,7 @@ void GLWListView::addLine(const char *fm va_list ap; va_start(ap, fmt); - vsprintf(text, fmt, ap); + vnsprintf(text, sizeof(text), fmt, ap); va_end(ap); lines_.push_back(text); --- scorched.orig/src/actions/Explosion.cpp 2003-12-02 16:46:43.000000000 -0500 +++ scorched.orig/src/actions/Explosion.cpp 2004-01-25 14:43:53.000000000 -0500 @@ -144,7 +144,7 @@ void Explosion::simulate(float frameTime if (weapon_->getExplosionSound()) { static char soundBuffer[256]; - sprintf(soundBuffer, PKGDIR "data/wav/%s", weapon_->getExplosionSound()); + snprintf(soundBuffer, sizeof(soundBuffer), "%sdata/wav/%s", PKGDIR, weapon_->getExplosionSound()); SoundBuffer *expSound = SoundStore::instance()->fetchOrCreateBuffer(soundBuffer); expSound->play(); --- scorched.orig/src/actions/ShieldHit.cpp 2003-11-11 19:08:56.000000000 -0500 +++ scorched.orig/src/actions/ShieldHit.cpp 2004-01-25 14:44:32.000000000 -0500 @@ -61,7 +61,7 @@ void ShieldHit::simulate(float frameTime if (!context_->serverMode) { char buffer[256]; - sprintf(buffer, PKGDIR "data/wav/%s", shield->getCollisionSound()); + snprintf(buffer, "%sdata/wav/%s", PKGDIR, shield->getCollisionSound()); SoundBuffer *shieldSound = SoundStore::instance()->fetchOrCreateBuffer(buffer); shieldSound->play(); --- scorched.orig/src/actions/ShotProjectileNapalm.cpp 2003-11-11 19:08:56.000000000 -0500 +++ scorched.orig/src/actions/ShotProjectileNapalm.cpp 2004-01-25 14:45:34.000000000 -0500 @@ -61,7 +61,7 @@ void ShotProjectileNapalm::collision(Vec if (weapon_->getExplosionSound()) { static char soundBuffer[256]; - sprintf(soundBuffer, PKGDIR "data/wav/%s", weapon_->getExplosionSound()); + snprintf(soundBuffer, sizeof(soundBuffer), "%sdata/wav/%s", PKGDIR, weapon_->getExplosionSound()); SoundBuffer *expSound = SoundStore::instance()->fetchOrCreateBuffer(soundBuffer); expSound->play(); --- scorched.orig/src/actions/TankFired.cpp 2003-11-11 19:08:56.000000000 -0500 +++ scorched.orig/src/actions/TankFired.cpp 2004-01-25 15:47:41.000000000 -0500 @@ -76,7 +76,7 @@ void TankFired::simulate(float frameTime if (weapon_->getFiredSound()) { static char soundBuffer[256]; - sprintf(soundBuffer, PKGDIR "data/wav/%s", weapon_->getFiredSound()); + snprintf(soundBuffer, sizeof(soundBuffer), "data/wav/%s", PKGDIR, weapon_->getFiredSound()); SoundBuffer *firedSound = SoundStore::instance()->fetchOrCreateBuffer(soundBuffer); --- scorched.orig/src/client/MainCamera.cpp 2003-11-24 18:21:42.000000000 -0500 +++ scorched.orig/src/client/MainCamera.cpp 2004-01-25 14:47:28.000000000 -0500 @@ -448,7 +448,7 @@ void MainCamera::SaveScreen::draw(const static unsigned counter = 0; time_t currentTime = time(0); char fileName[256]; - sprintf(fileName, PKGDIR "ScreenShot-%i-%i.bmp", currentTime, counter++); + snprintf(fileName, sizeof(fileName), "%sScreenShot-%i-%i.bmp", PKGDIR, currentTime, counter++); GLBitmap screenMap; screenMap.grabScreen();