From 7e6d2f95c54cd031f0fd513f8bd574a294125fdd Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 27 Aug 2000 11:05:11 +0000 Subject: [PATCH] gl_model.c: sprintf -> snprintf gl_rmain.c: slight optimisation (thanks, LordHavoc) --- source/gl_model.c | 2 +- source/gl_rmain.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/gl_model.c b/source/gl_model.c index 50fc4d7..341fdba 100644 --- a/source/gl_model.c +++ b/source/gl_model.c @@ -1253,7 +1253,7 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer) { // duplicate the basic information char name[10]; - sprintf (name, "*%i", i+1); + snprintf (name, sizeof(name), "*%i", i+1); loadmodel = Mod_FindName (name); *loadmodel = *mod; strcpy (loadmodel->name, name); diff --git a/source/gl_rmain.c b/source/gl_rmain.c index e29a689..18bf44f 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -578,7 +578,7 @@ static void R_DrawAliasModel (entity_t *e) VectorSubtract (currententity->origin, cl_dlights[lnum].origin, dist); - add = (cl_dlights[lnum].radius * cl_dlights[lnum].radius * 8) / (Length(dist) * Length(dist)); // FIXME Deek + add = (cl_dlights[lnum].radius * cl_dlights[lnum].radius * 8) / (DotProduct(dist, dist)); // FIXME Deek if (add > 0) {