[Fwd: Re: [GRASS-dev] r.colors: rules file list unsorted]

Wolf Bergenheim wolf+grass at bergenheim.net
Sun Jan 28 17:03:43 EST 2007


Hamish wrote:
> +       struct dirent **d;
> ..
> +       l = scandir(path, &d, 0, alphasort);
> ..
> +                       G_free(d[i]);
> 
> 
> I am not very good with pointers, but shouldn't there be a G_malloc()
> somewhere if G_free() is used?
>

scandir does the allocation.

> or another way:  should we keep malloc()+free() separate from
> G_malloc()+G_free()? ie don't mix the two?
> 

Isn't G_free just a wrapper for free, so that programmers don't need to 
worry about linking with correct allocation libraries, and including 
headers which vary on some UNIX platforms?

-- 

<:3 )---- Wolf Bergenheim ----( 8:>




More information about the grass-dev mailing list