From 1891c1c3025d1315cd0ad81251da31da9f35207d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 4 May 2022 21:01:39 +0900 Subject: [PATCH] [qflight] Replace a sprintf with va While 16 chars is plenty for a 32-bit int, just seeing sprintf is enough reason to make the change. --- tools/qflight/source/entities.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/qflight/source/entities.c b/tools/qflight/source/entities.c index 85ce43431..0157014f8 100644 --- a/tools/qflight/source/entities.c +++ b/tools/qflight/source/entities.c @@ -125,7 +125,7 @@ MatchTargets (void) // set the style on the source ent for switchable lights if (entities[j].style) { entities[i].style = entities[j].style; - SetKeyValue (&entities[i], "style", va (0, "%i", + SetKeyValue (&entities[i], "style", va (0, "%d", entities[i].style)); } @@ -334,12 +334,9 @@ LoadEntities (void) if (entity->classname && !strcmp (entity->classname, "light")) { if (entity->targetname && entity->targetname[0] && !entity->style) { - char s[16]; - entity->style = LightStyleForTargetname (entity->targetname, true); - sprintf (s, "%i", entity->style); - SetKeyValue (entity, "style", s); + SetKeyValue (entity, "style", va (0, "%d", entity->style)); } } }