[Xastir] Can't write objects...

Reuven Z Gevaryahu gevaryah at netaxs.com
Mon Nov 15 23:51:26 EST 2004


Mike Markowski wrote:

> Something strange is definitely going on.  Permissions ar ok, but it
> seems that fprintf is always returning '1' even when it successfully
> writes data.  In maps.c at around line 4940 I modified the code while
> debugging to this:

>             if (fprintf(f,"%s",out_string) < (int)strlen(out_string)) {
>                 // Failed to write
>                 fprintf(stderr,"Couldn't write objects to map index file: %s\n",
>                     MAP_INDEX_DATA);
>                 //current = NULL; // All done
>             }

>             current = current->next;

I can't speak for the printf problem, but doing "current = NULL" then 
"current = current->next" will cause a null pointer dereference, and 
hence a segfault. There should probably be a "continue;" after the 
"current = NULL", but I'll defer to Curt who wrote this code IIRC.

--Reuven (KB3EHW)



More information about the Xastir mailing list