Consider the code below, I am asking for 255 chars of data (I allocated
256). SYMPTOM: In the first iteration through the loop, the value of i
is overwritten and ends up being some large integer.
Changing the order of declaration to:
int i;
char res[256];
fixes the problem. Looks like cdev is putting more in than I want.
-Johannes
void TclCdevCollection::getResult(Tcl_Interp *interp) {
char res[256];
int i;
for (i = 0; i < ndevices; i++) {
results[i].get(VALUE_TAG, res, 255);
cout << i << endl;
// Tcl_AppendElement(interp, res);
}
}