Skip to content

Commit

Permalink
STYLE: Replace memset with {} assignment when zero-filling a struct
Browse files Browse the repository at this point in the history
Removed an unsafe `(void *)pPar` cast from `PhilipsPAR::ReadPAR`.
  • Loading branch information
N-Dekker committed Oct 6, 2024
1 parent 5e9c722 commit 5bca870
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/IO/PhilipsREC/src/itkPhilipsPAR.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ PhilipsPAR::ReadPAR(std::string parFile, struct par_parameter * pPar)
}

// Zero out struct.
memset((void *)pPar, 0, sizeof(struct par_parameter));
*pPar = {};
// Need to set strings to UNDEFINED to avoid segmentation faults.
strcpy(pPar->patient_name, UNDEFINED);
strcpy(pPar->exam_name, UNDEFINED);
Expand Down

0 comments on commit 5bca870

Please sign in to comment.