diff options
author | peter1138 <peter1138@openttd.org> | 2008-05-25 16:22:34 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-05-25 16:22:34 +0000 |
commit | cfc8ed1f5b4bca8290d06c603e67b2252cc67c27 (patch) | |
tree | d9743df3d4b8140b6111c28ceeab86ba0197fa09 | |
parent | da8bb14ceca9f306c4df4430ba1647bdde5afe47 (diff) | |
download | openttd-cfc8ed1f5b4bca8290d06c603e67b2252cc67c27.tar.xz |
(svn r13246) -Fix (r13245): incorrect parameters to memcpy
-rw-r--r-- | src/vehicle.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 1b1d87af5..ba79ef830 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1313,14 +1313,14 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, Vehicle ***engine_l if (engines.Length() > 0) { *engine_list = ReallocT(*engine_list, engines.Length()); - memcpy(*engine_list, engines[0], sizeof(engines[0]) * engines.Length()); + memcpy(*engine_list, engines.Begin(), sizeof(engines.Begin()) * engines.Length()); } if (engine_count != NULL) *engine_count = engines.Length(); if (wagon_list != NULL && wagon_list != engine_list) { if (wagons.Length() > 0) { *wagon_list = ReallocT(*wagon_list, wagons.Length()); - memcpy(*wagon_list, wagons[0], sizeof(wagons[0]) * wagons.Length()); + memcpy(*wagon_list, wagons.Begin(), sizeof(wagons.Begin()) * wagons.Length()); } if (wagon_count != NULL) *wagon_count = wagons.Length(); } @@ -1392,7 +1392,7 @@ uint GenerateVehicleSortList(const Vehicle ***sort_list, uint16 *length_of_array if (list.Length() > 0) { *sort_list = ReallocT(*sort_list, list.Length()); - memcpy(*sort_list, list[0], sizeof(list[0]) * list.Length()); + memcpy(*sort_list, list.Begin(), sizeof(list.Begin()) * list.Length()); } return list.Length(); |