[GRASS-dev] etc file finder, take 2

Glynn Clements glynn at gclements.plus.com
Thu Apr 19 11:35:08 EDT 2007


Hamish wrote:

> > use GPATH_MAX as the size of the path buffer (I've
> > been replacing various random constants with that value as I find
> > them; also for GNAME_MAX and GMAPSET_MAX)..
> 
> more of a comment than a question-
> 
> "char input_map[GNAME_MAX];" is often used to hold input=map at mapset
> name, when the array often should be able to hold "GNAME_MAX + @ +
> GMAPSET_MAX + \0" = 514 chars.
> 
> GNAME_MAX is long enough (256, gis.h) that map at mapset should rarely
> exceed that, but it's something to look out for.
> 
> Perhaps gis.h should also have G_FULLYQUALIFIED_MAX ?

Who said that GNAME_MAX referred to the length of an *unqualified*
name?

It's just an arbitrary value used for array dimensions; nothing
actually checks map names against that value.

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




More information about the grass-dev mailing list