- if (parity != NULL && iLen != 0) {
- memcpy(trace + traceLen, parity, num_paritybytes);
+ if (num_paritybytes != 0) {
+ if (parity != NULL) {
+ for (int i = 0; i < num_paritybytes; i++) {
+ trace[traceLen++] = *parity++;
+ }
+ } else {
+ for (int i = 0; i < num_paritybytes; i++) {
+ trace[traceLen++] = 0x00;
+ }
+ }