Code review comment for lp:~mdavidsaver/epics-base/rec-init

Revision history for this message
mdavidsaver (mdavidsaver) wrote :

> Your stringin/stringout changes contain this:
>
> strncpy(prec->oval,prec->val,sizeof(prec->val));
>
> Please use sizeof(prec->oval) instead, since that's the destination of the
> string copy. It would be a bug if the sizes of the two fields are ever
> different, but this is more robust if that does happen.

Add a STATIC_ASSERT of the two field sizes since they should never be different. Also for aSub.

Also since val is set by dbPut it will always be null terminated (see dbConvert.c). The aSub recordtype was assuming this already.

« Back to merge proposal