Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 39302
Collapse All | Expand All

(-)scorched.orig/src/3dsparse/ModelID.cpp (-4 / +4 lines)
Lines 27-33 Link Here
27
static const char *getDirectoryPath(const char *file)
27
static const char *getDirectoryPath(const char *file)
28
{
28
{
29
	static char buffer[256];
29
	static char buffer[256];
30
	sprintf(buffer, PKGDIR "%s", file);
30
	snprintf(buffer, sizeof(buffer), "%s%s", PKGDIR, file);
31
	return buffer;
31
	return buffer;
32
}
32
}
33
33
Lines 80-90 bool ModelID::initFromNode(const char *d Link Here
80
80
81
		const char *skinNameContent = skinNode->getContent();
81
		const char *skinNameContent = skinNode->getContent();
82
		static char skinName[1024];
82
		static char skinName[1024];
83
		sprintf(skinName, "%s/%s", directory, skinNameContent);
83
		snprintf(skinName, sizeof(skinName), "%s/%s", directory, skinNameContent);
84
84
85
		const char *meshNameContent = meshNode->getContent();
85
		const char *meshNameContent = meshNode->getContent();
86
		static char meshName[1024];
86
		static char meshName[1024];
87
		sprintf(meshName, "%s/%s", directory, meshNameContent);
87
		snprintf(meshName, sizeof(meshName), "%s/%s", directory, meshNameContent);
88
88
89
		if (!::wxFileExists(getDirectoryPath(skinName)))
89
		if (!::wxFileExists(getDirectoryPath(skinName)))
90
		{
90
		{
Lines 108-114 bool ModelID::initFromNode(const char *d Link Here
108
	{
108
	{
109
		const char *meshNameContent = modelNode->getContent();
109
		const char *meshNameContent = modelNode->getContent();
110
		static char meshName[1024];
110
		static char meshName[1024];
111
		sprintf(meshName, "%s/%s", directory, meshNameContent);
111
		snprintf(meshName, sizeof(meshName),"%s/%s", directory, meshNameContent);
112
112
113
		if (!::wxFileExists(getDirectoryPath(meshName)))
113
		if (!::wxFileExists(getDirectoryPath(meshName)))
114
		{
114
		{
(-)scorched.orig/src/GLEXT/GLConsole.cpp (-1 / +1 lines)
Lines 231-237 void GLConsole::addLine(bool parse, cons Link Here
231
	va_list ap;
231
	va_list ap;
232
232
233
	va_start(ap, fmt);
233
	va_start(ap, fmt);
234
	vsprintf(text, fmt, ap);
234
	vsnprintf(text, sizeof(text), fmt, ap);
235
	va_end(ap);
235
	va_end(ap);
236
236
237
	DIALOG_ASSERT(strlen(text)<TEXT_SIZE);
237
	DIALOG_ASSERT(strlen(text)<TEXT_SIZE);
(-)scorched.orig/src/GLEXT/GLFont2d.cpp (-3 / +3 lines)
Lines 55-61 void GLFont2d::draw(Vector &color, float Link Here
55
	va_list ap;
55
	va_list ap;
56
56
57
	va_start(ap, fmt);
57
	va_start(ap, fmt);
58
	vsprintf(text, fmt, ap);
58
	vnsprintf(text, sizeof(text), fmt, ap);
59
	va_end(ap);	
59
	va_end(ap);	
60
60
61
	drawString((GLsizei) strlen(text), color, size, x, y, z, text, false);
61
	drawString((GLsizei) strlen(text), color, size, x, y, z, text, false);
Lines 69-75 void GLFont2d::drawLen(unsigned len, Vec Link Here
69
	va_list ap;
69
	va_list ap;
70
70
71
	va_start(ap, fmt);
71
	va_start(ap, fmt);
72
	vsprintf(text, fmt, ap);
72
	vsnprintf(text, sizeof(text), fmt, ap);
73
	va_end(ap);	
73
	va_end(ap);	
74
74
75
	GLsizei l = (GLsizei) (MIN(len, strlen(text)));
75
	GLsizei l = (GLsizei) (MIN(len, strlen(text)));
Lines 84-90 void GLFont2d::drawBilboard(Vector &colo Link Here
84
	va_list ap;
84
	va_list ap;
85
85
86
	va_start(ap, fmt);
86
	va_start(ap, fmt);
87
	vsprintf(text, fmt, ap);
87
	vsnprintf(text, sizeof(text), fmt, ap);
88
	va_end(ap);	
88
	va_end(ap);	
89
89
90
	drawString((GLsizei) strlen(text), color, size, x, y, z, text, true);
90
	drawString((GLsizei) strlen(text), color, size, x, y, z, text, true);
(-)scorched.orig/src/GLEXT/GLFontBanner.cpp (-1 / +1 lines)
Lines 97-103 void GLFontBanner::addLine(Vector &color Link Here
97
	va_list ap;
97
	va_list ap;
98
98
99
	va_start(ap, fmt);
99
	va_start(ap, fmt);
100
	vsprintf(text, fmt, ap);
100
	vsnprintf(text, sizeof(text), fmt, ap);
101
	va_end(ap);	
101
	va_end(ap);	
102
102
103
	if (textRemoved)
103
	if (textRemoved)
(-)scorched.orig/src/GLEXT/GLLenseFlare.cpp (-2 / +2 lines)
Lines 103-109 void GLLenseFlare::init(ProgressCounter Link Here
103
		if (counter) counter->setNewPercentage(float (i) / 16.0f * 100.0f);
103
		if (counter) counter->setNewPercentage(float (i) / 16.0f * 100.0f);
104
104
105
		char buffer[100];
105
		char buffer[100];
106
		sprintf(buffer,  PKGDIR "data/textures/lensflare/shine%d.bw", i);
106
		snprintf(buffer, sizeof(buffer), "%sdata/textures/lensflare/shine%d.bw", PKGDIR, i);
107
107
108
		GLLuminance bitmap(buffer);
108
		GLLuminance bitmap(buffer);
109
		shines_[i].create(bitmap, GL_LUMINANCE);
109
		shines_[i].create(bitmap, GL_LUMINANCE);
Lines 114-120 void GLLenseFlare::init(ProgressCounter Link Here
114
		if (counter) counter->setNewPercentage(float (i+10) / 16.0f * 100.0f);
114
		if (counter) counter->setNewPercentage(float (i+10) / 16.0f * 100.0f);
115
115
116
		char buffer[100];
116
		char buffer[100];
117
		sprintf(buffer ,  PKGDIR "data/textures/lensflare/flare%d.bw", i);
117
		snprintf(buffer , "%sdata/textures/lensflare/flare%d.bw", PKGDIR, i);
118
118
119
		GLLuminance bitmap(buffer);
119
		GLLuminance bitmap(buffer);
120
		flares_[i].create(bitmap, GL_LUMINANCE);
120
		flares_[i].create(bitmap, GL_LUMINANCE);
(-)scorched.orig/src/GLW/GLWListView.cpp (-1 / +1 lines)
Lines 101-107 void GLWListView::addLine(const char *fm Link Here
101
	va_list ap;
101
	va_list ap;
102
102
103
	va_start(ap, fmt);
103
	va_start(ap, fmt);
104
	vsprintf(text, fmt, ap);
104
	vnsprintf(text, sizeof(text), fmt, ap);
105
	va_end(ap);	
105
	va_end(ap);	
106
106
107
	lines_.push_back(text);
107
	lines_.push_back(text);
(-)scorched.orig/src/actions/Explosion.cpp (-1 / +1 lines)
Lines 144-150 void Explosion::simulate(float frameTime Link Here
144
				if (weapon_->getExplosionSound())
144
				if (weapon_->getExplosionSound())
145
				{
145
				{
146
					static char soundBuffer[256];
146
					static char soundBuffer[256];
147
					sprintf(soundBuffer, PKGDIR "data/wav/%s", weapon_->getExplosionSound());
147
					snprintf(soundBuffer, sizeof(soundBuffer), "%sdata/wav/%s", PKGDIR, weapon_->getExplosionSound());
148
					SoundBuffer *expSound = 
148
					SoundBuffer *expSound = 
149
						SoundStore::instance()->fetchOrCreateBuffer(soundBuffer);
149
						SoundStore::instance()->fetchOrCreateBuffer(soundBuffer);
150
					expSound->play();
150
					expSound->play();
(-)scorched.orig/src/actions/ShieldHit.cpp (-1 / +1 lines)
Lines 61-67 void ShieldHit::simulate(float frameTime Link Here
61
				if (!context_->serverMode) 
61
				if (!context_->serverMode) 
62
				{
62
				{
63
					char buffer[256];
63
					char buffer[256];
64
					sprintf(buffer, PKGDIR "data/wav/%s", shield->getCollisionSound());
64
					snprintf(buffer, "%sdata/wav/%s", PKGDIR, shield->getCollisionSound());
65
					SoundBuffer *shieldSound = 
65
					SoundBuffer *shieldSound = 
66
						SoundStore::instance()->fetchOrCreateBuffer(buffer);
66
						SoundStore::instance()->fetchOrCreateBuffer(buffer);
67
					shieldSound->play();
67
					shieldSound->play();
(-)scorched.orig/src/actions/ShotProjectileNapalm.cpp (-1 / +1 lines)
Lines 61-67 void ShotProjectileNapalm::collision(Vec Link Here
61
		if (weapon_->getExplosionSound())
61
		if (weapon_->getExplosionSound())
62
		{
62
		{
63
			static char soundBuffer[256];
63
			static char soundBuffer[256];
64
			sprintf(soundBuffer, PKGDIR "data/wav/%s", weapon_->getExplosionSound());
64
			snprintf(soundBuffer, sizeof(soundBuffer), "%sdata/wav/%s", PKGDIR, weapon_->getExplosionSound());
65
			SoundBuffer *expSound = 
65
			SoundBuffer *expSound = 
66
				SoundStore::instance()->fetchOrCreateBuffer(soundBuffer);
66
				SoundStore::instance()->fetchOrCreateBuffer(soundBuffer);
67
			expSound->play();
67
			expSound->play();
(-)scorched.orig/src/actions/TankFired.cpp (-1 / +1 lines)
Lines 76-82 void TankFired::simulate(float frameTime Link Here
76
				if (weapon_->getFiredSound())
76
				if (weapon_->getFiredSound())
77
				{
77
				{
78
					static char soundBuffer[256];
78
					static char soundBuffer[256];
79
					sprintf(soundBuffer, PKGDIR "data/wav/%s", weapon_->getFiredSound());
79
					snprintf(soundBuffer, sizeof(soundBuffer), "data/wav/%s", PKGDIR, weapon_->getFiredSound());
80
80
81
					SoundBuffer *firedSound = 
81
					SoundBuffer *firedSound = 
82
						SoundStore::instance()->fetchOrCreateBuffer(soundBuffer);
82
						SoundStore::instance()->fetchOrCreateBuffer(soundBuffer);
(-)scorched.orig/src/client/MainCamera.cpp (-1 / +1 lines)
Lines 448-454 void MainCamera::SaveScreen::draw(const Link Here
448
	static unsigned counter = 0;
448
	static unsigned counter = 0;
449
	time_t currentTime = time(0);
449
	time_t currentTime = time(0);
450
	char fileName[256];
450
	char fileName[256];
451
	sprintf(fileName, PKGDIR "ScreenShot-%i-%i.bmp", currentTime, counter++);
451
	snprintf(fileName, sizeof(fileName), "%sScreenShot-%i-%i.bmp", PKGDIR, currentTime, counter++);
452
452
453
	GLBitmap screenMap;
453
	GLBitmap screenMap;
454
	screenMap.grabScreen();
454
	screenMap.grabScreen();

Return to bug 39302