Can anyone comment on our XmGetSecondaryResourceData() implementation?
After I succeeded in building vdx (I had to use an old gcc; gcc 2.9.x doesn't
work - I assume the code is not ANSI C++ compliant) I was able to start up
the app.
Loading an arbitrary project seems to trigger a crash caused
by bogus data supplied by XmGetSecondaryResourceData().
Attached is a test program taken from the DU 4.0x man page.
On DU I get this result:
!/leer $ ./a
selectionArray
selectionArrayCount
pendingDelete
selectThreshold
fontList
wordWrap
blinkRate
columns
rows
resizeWidth
resizeHeight
scrollVertical
scrollHorizontal
scrollLeftSide
scrollTopSide
cursorPositionVisible
LessTif's doesn't 'say' anything.
The problem may be much deeper inside LessTif than the call given
above ...
--
Alexander Mai
[EMAIL PROTECTED]
[EMAIL PROTECTED]
#include <stdlib.h>
#include <stdio.h>
#include <Xm/Xm.h>
#include <Xm/Text.h>
void test1(void) {
XmSecondaryResourceData * block_array ;
Cardinal num_blocks, i, j ;
if (num_blocks = XmGetSecondaryResourceData (xmTextWidgetClass,
&block_array)) {
for (i = 0; i < num_blocks; i++) {
for (j = 0 ; j < block_array[i]->num_resources; j++) {
printf("%s\n", block_array[i]->resources[j].resource_name);
}
XtFree((char*)block_array[i]->resources);
XtFree((char*)block_array[i]);
}
XtFree((char*)block_array);
}
}
int main(int argc, char *argv[]) {
test1();
exit(0);
}