(svn r14508) -Fix (r14501): arrays were not properly zeroed
authorsmatz
Tue, 21 Oct 2008 14:56:23 +0000
changeset 10273 7ab559547892
parent 10272 e773c78f615c
child 10274 4173a4a89178
(svn r14508) -Fix (r14501): arrays were not properly zeroed
src/station_cmd.cpp
--- a/src/station_cmd.cpp	Tue Oct 21 12:15:09 2008 +0000
+++ b/src/station_cmd.cpp	Tue Oct 21 14:56:23 2008 +0000
@@ -425,7 +425,7 @@
 void GetProductionAroundTiles(AcceptedCargo produced, TileIndex tile,
 	int w, int h, int rad)
 {
-	memset(produced, 0, sizeof(produced));
+	memset(produced, 0, sizeof(AcceptedCargo)); // sizeof(AcceptedCargo) != sizeof(produced) (== sizeof(uint *))
 
 	int x = TileX(tile);
 	int y = TileY(tile);
@@ -474,7 +474,7 @@
 void GetAcceptanceAroundTiles(AcceptedCargo accepts, TileIndex tile,
 	int w, int h, int rad)
 {
-	memset(accepts, 0, sizeof(accepts));
+	memset(accepts, 0, sizeof(AcceptedCargo)); // sizeof(AcceptedCargo) != sizeof(accepts) (== sizeof(uint *))
 
 	int x = TileX(tile);
 	int y = TileY(tile);