"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> struct varlena *data;
> char *word = NULL;
> char *cur_pos = NULL;
> int cur_pos_length = 0;
> data = (struct varlena *) palloc(column_length);
> while(cur_pos > word)
> {
> cur_pos_length = strlen(cur_pos);
> /* Line below causes seg fault on SECOND iteration */
You are not telling the whole truth here, as the above code excerpt
will obviously never iterate the WHILE even once. "NULL > NULL" is
false in every C I ever heard of.
Also, how much is column_length and how does it relate to the amount
of data being copied into *data ?
regards, tom lane