Use direct assignment to replace memcpy
memcpy does not work here.
Test: Telephony sanity tests
Bug: 30954762
Change-Id: I1e1048fc358bd57df2b230caef16ebf84e255c0a
diff --git a/libril/ril_service.cpp b/libril/ril_service.cpp
index 205436e..324e138 100644
--- a/libril/ril_service.cpp
+++ b/libril/ril_service.cpp
@@ -1372,7 +1372,9 @@
return Void();
}
// safe to copy to geran_bands because it's a union member
- std::memcpy(&ras_to.bands.geran_bands, bands, ras_to.bands_length * sizeof(uint32_t));
+ for (size_t idx = 0; idx < ras_to.bands_length; ++idx) {
+ ras_to.bands.geran_bands[idx] = (RIL_GeranBands) (*bands)[idx];
+ }
}
s_vendorFunctions->onRequest(