diff --git a/src/evm.c b/src/evm.c index e5844a1..659f602 100644 --- a/src/evm.c +++ b/src/evm.c @@ -213,12 +213,9 @@ static int evrsrm_pre_reservation_response(uint8_t *evrsrm_oer, uint32_t *evrsrm evrsr_response->messageBody.present = EV_RSR_MessageBody_PR_preReservationResponseMessage; PreReservationResponseMessage_t response = evrsr_response->messageBody.choice.preReservationResponseMessage; - response.preReservation_ID.buf = calloc(4, sizeof(uint8_t)); - response.preReservation_ID.size = 4; - response.preReservation_ID.buf[0] = (pre_reservation_id >> 24) & 0xff; - response.preReservation_ID.buf[1] = (pre_reservation_id >> 16) & 0xff; - response.preReservation_ID.buf[2] = (pre_reservation_id >> 8) & 0xff; - response.preReservation_ID.buf[3] = pre_reservation_id & 0xff; + response.preReservation_ID.buf = calloc(8, sizeof(uint8_t)); + response.preReservation_ID.size = 8; + *(uint64_t *)response.preReservation_ID.buf = pre_reservation_id; response.availabilityStatus = 0;