[GRASS-dev] d.legend uses a static buffer for `map='
Markus Neteler
neteler at osgeo.org
Fri Jan 11 15:46:20 EST 2008
On Jan 11, 2008 10:31 PM, Glynn Clements <glynn at gclements.plus.com> wrote:
>
> 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.
First step done:
http://trac.osgeo.org/grass/changeset/29670
Markus
> 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>
>
--
Open Source Geospatial Foundation
http://www.osgeo.org/
http://www.grassbook.org/
More information about the grass-dev
mailing list