summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-05-25 16:22:34 +0000
committerpeter1138 <peter1138@openttd.org>2008-05-25 16:22:34 +0000
commit449a03be4b729d4a3cd7cfb228ec34b19c9f349b (patch)
treed9743df3d4b8140b6111c28ceeab86ba0197fa09 /src/vehicle.cpp
parentbcd05a4bcebb6a89fe73cd6c35a119cf70373c84 (diff)
downloadopenttd-449a03be4b729d4a3cd7cfb228ec34b19c9f349b.tar.xz
(svn r13246) -Fix (r13245): incorrect parameters to memcpy
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp6
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();