Lots of str[n]cat, str[n]cpy, and [v]sprintf have been replaced by strlcat, strlcpy...
[xonotic/darkplaces.git] / cl_main.c
index b235339..b57f450 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -268,10 +268,9 @@ static void CL_PrintEntities_f(void)
                        continue;
 
                if (ent->render.model)
-                       strncpy(name, ent->render.model->name, 25);
+                       strlcpy (name, ent->render.model->name, 25);
                else
                        strcpy(name, "--no model--");
-               name[25] = 0;
                for (j = strlen(name);j < 25;j++)
                        name[j] = ' ';
                Con_Printf ("%3i: %s:%04i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, name, ent->render.frame, (int) ent->render.origin[0], (int) ent->render.origin[1], (int) ent->render.origin[2], (int) ent->render.angles[0] % 360, (int) ent->render.angles[1] % 360, (int) ent->render.angles[2] % 360, ent->render.scale, ent->render.alpha);