[GRASS-dev] d.legend uses a static buffer for `map='

Glynn Clements glynn at gclements.plus.com
Fri Jan 11 16:31:43 EST 2008


Markus Neteler wrote:

> > > PS.  Shouldn't G__open () use GPATH_MAX as well?
> >
> > Yes. And GNAME_MAX and GMAPSET_MAX.
> >
> > And it shouldn't be freeing the mapset either.
> 
> Here are a couple of candidates:
> 
> cd lib/gis/
> grep path *.c | grep char | grep -v GPATH_MAX | grep '\['
> closecell.c:    char path[4096];
> get_ellipse.c:    char ipath[1024], *str, *str1;
> get_projinfo.c: char path[1024];
> get_projinfo.c: char path[1024];
> get_projname.c: char path[1024], buff[1024], answer[50], *a;
> get_window.c:char path[1024];
> make_loc.c:    char     path[2048];
> make_mapset.c:    char  path[2048];
> myname.c:    char path[500];
> open.c:    char path[1024];
> remove.c:       char path2[4096];
> 
> Change all of them to GPATH_MAX?

Yes.

More generally, anything matching:

	grep '\[[0-9][0-9][0-9]*\]'

deserves at least a cursory glance. Many of those should really be
using a #define'd constant, even if it's local to a single source
file.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list