On 30/10/2011, at 9:40 AM, john skaller wrote:

> Hi, I'm having some problems with JudySL .. not sure what's going on.


Hmm .. what am I doing wrong here? This is a simple C program...

#include "Judy.h"
#include <stdio.h>

int main()
{
  printf("Judy test\n");
  JError_t je;
  void *ja = NULL;
  Word_t *pv;
  char buffer[1000];
  int i;

  for (i=0; i<1000; ++i) {
    sprintf(buffer,"XX %04d abcdefg",i);
    pv = (Word_t*)JudySLIns(&ja, buffer, &je);
    *pv = i;
    printf("Done %s -> %d\n",buffer, i);
  }

  buffer[0]=0;
  pv = (Word_t*)JudySLFirst(ja,buffer,&je);
  while(pv)
  {
    i = (int)*pv;
    printf("found %s -> %d\n",buffer, i);
    pv = (Word_t*)JudySLNext(ja,buffer,&je);
  }
}


Output:

Done XX 0998 abcdefg -> 998
Done XX 0999 abcdefg -> 999
Segmentation fault

--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Get your Android app more play: Bring it to the BlackBerry PlayBook 
in minutes. BlackBerry App World&#153; now supports Android&#153; Apps 
for the BlackBerry&reg; PlayBook&#153;. Discover just how easy and simple 
it is! http://p.sf.net/sfu/android-dev2dev
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to