Hello, I have the following code:
size = sizeof(TWaveform) + nSamples * sizeof(double);
wf = (TWaveform*) malloc(size);
if(!wf)
return NULL;
memset(wf, 0, size);
and this code blows on "memset" line with the following error:
FATAL RUN-TIME ERROR: "Waveform.c", line 51, col 12, thread id 0x000003A4: Array argument too small (816 bytes). Argument must contain at least 848 bytes (848 elements).
The weird thing is that the memset clears exact amount of bytes that have been allocated (variable size). Visual C++ has no problem compiling and running this code. So does CVI when disabling runtime checks, but we do not want to run completely without them.
Thank you
Roman