It wasn't me, it was all valgrind's fault. btw. Looking at the stuff I replaced around the call to system, the old code did the alloc/free right, so the segfaults must have come from either the bad malloc or one of the double free's.

And as far as indentation is concerned, at least you're not following the fsf coding style and as an additional ++ you are using vi
_________________________
40GB - serial #40104051 gpsapp