Robert Baruch wrote:
Hi all,

Can someone tell me what's wrong? In my program, when LstSetListChoices is hit, 
the emulator dies with an array index out of bounds.

Here's the code fragment:

static void displayCallLog()
{
  ListType *list;
  char *duration;
  char *testArray[] = {"one", "two", "three", "four", "five"};

list = FrmGetObjectPtr(
FrmGetFormPtr(GetCallLogForm), CallLogTable);
LstSetListChoices(list, testArray, 5);
LstDrawList(list);

LstSetListChoices doesn't copy the contents of your pointer. So, as soon as you leave displayCallLog and testArray is removed from memory the list has an invalid pointer.


        Luciano

--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to