Skip to content

Commit

Permalink
make cfg->bc a null terminated string
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Oct 3, 2023
1 parent 35170f9 commit 68db492
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mcx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ void mcx_initcfg(Config* cfg) {
cfg->nphase = 0;
cfg->invcdf = NULL;
memset(cfg->jsonfile, 0, MAX_PATH_LENGTH);
memset(cfg->bc, 0, 12);
memset(cfg->bc, 0, 13);
memset(&(cfg->srcparam1), 0, sizeof(float4));
memset(&(cfg->srcparam2), 0, sizeof(float4));
memset(cfg->deviceid, 0, MAX_DEVICE);
Expand Down
2 changes: 1 addition & 1 deletion src/mcx_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ typedef struct MCXConfig {
float* dx; /**< anisotropic voxel spacing for x-axis */
float* dy; /**< anisotropic voxel spacing for y-axis */
float* dz; /**< anisotropic voxel spacing for z-axis */
char bc[12]; /**<boundary condition flag for [-x,-y,-z,+x,+y,+z, det(-x,-y,-z,+x,+y,+z)] */
char bc[13]; /**<boundary condition flag for [-x,-y,-z,+x,+y,+z, det(-x,-y,-z,+x,+y,+z)] */
unsigned int nphase; /**< number of samples for inverse-cdf, will be added by 2 to include -1 and 1 on the two ends */
float* invcdf; /**< equal-space sampled inversion of CDF(cos(theta)) for the phase function of the zenith angle */
} Config;
Expand Down

0 comments on commit 68db492

Please sign in to comment.