- fixed several warnings emitted by Clang.

This commit is contained in:
Christoph Oelckers 2023-03-26 08:33:09 +02:00
commit 47b76180d6
12 changed files with 21 additions and 16 deletions

View file

@ -218,7 +218,7 @@ void FEventTree::PrintTree (const FEvent *event) const
if (event != &Nil)
{
PrintTree(event->Left);
sprintf(buff, " Distance %g, vertex %d, seg %u\n",
snprintf(buff, sizeof(buff), " Distance %g, vertex %d, seg %u\n",
g_sqrt(event->Distance/4294967296.0), event->Info.Vertex, (unsigned)event->Info.FrontSeg);
Printf(PRINT_LOG, "%s", buff);
PrintTree(event->Right);

View file

@ -99,7 +99,7 @@ void FNodeBuilder::FixSplitSharers (const node_t &node)
// Use the CRT's printf so the formatting matches ZDBSP's
D(char buff[200]);
D(sprintf(buff, "Considering events on seg %d(%d[%d,%d]->%d[%d,%d]) [%g:%g]\n", seg,
D(snprintf(buff, sizeof(buff), "Considering events on seg %d(%d[%d,%d]->%d[%d,%d]) [%g:%g]\n", seg,
Segs[seg].v1,
Vertices[Segs[seg].v1].x>>16,
Vertices[Segs[seg].v1].y>>16,