OSDN Git Service

Merge "Use direct assignment to replace memcpy" am: d5461a4f08 am: 97abdd412e am...
[android-x86/hardware-ril.git] / libril / ril_service.cpp
index b6e2149..672bc0c 100644 (file)
@@ -1398,7 +1398,9 @@ Return<void> RadioImpl::startNetworkScan(int32_t serial, const NetworkScanReques
                 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];
+        }
     }
 
     CALL_ONREQUEST(RIL_REQUEST_START_NETWORK_SCAN, &scan_request, sizeof(scan_request), pRI,