shithub: nanobsp

Download patch

ref: 582637378657b7ed70f39b3fcf0c615a9d9c2a30
parent: f43f12363861625ef9c454a90e5c9fd7a0af9781
author: Andrew Apted <ajapted@gmail.com>
date: Fri Dec 15 13:33:36 EST 2023

memset the `nodes` and `subsectors` arrays to zero.

In this code-base it is not necessary, since we initialize every field
by the BSP_WriteXXX() functions.  However other code-bases may add new
fields to those structures, and would need those fields initialized.

--- a/nano_bsp.c
+++ b/nano_bsp.c
@@ -794,6 +794,10 @@
 	subsectors = Z_Malloc (numsubsectors*sizeof(subsector_t), PU_LEVEL, NULL);
 	segs       = Z_Malloc (numsegs*sizeof(seg_t), PU_LEVEL, NULL);
 
+	// clear the initial contents
+	memset (nodes, 0, numnodes*sizeof(node_t));
+	memset (subsectors, 0, numsubsectors*sizeof(subsector_t));
+
 	nano_seg_index = 0;
 
 	fixed_t dummy[4];
--