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

Ivan Shmakov ivan at theory.asu.ru
Sat Jan 12 04:52:05 EST 2008


>>>>> Glynn Clements <glynn at gclements.plus.com> writes:

[...]

 > 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.

	Could you review the attached patch?

	Things I didn't change with this patch:

	* buffers related to SQL commands, because I know no appropriate
	  Cpp macro for these;

	* buffers related to command lines to be passed to system (),
	  since I believe that using a specific library to construct the
	  arguments lists to be passed to an `exec' family function
	  directly would be a better solution; (check the `man-db'
	  source [1] for a suitable facility);

	* misused G_warning (), etc.; like:

   char BUF[...];
   sprintf (BUF, FORMAT, ...);
   G_warning (BUF);

	  instead of:

   G_warning (FORMAT, ...);

	  (the documentation should emphasize the first argument being
	  the printf ()-style format string, and /not/ the message);
	  there're just too many of these and I hope to handle them with
	  a script;

	* use of gets ()-like functions to discard everything on stdin
	  until the next newline; a separate function is needed there;

	* all the other things I've missed or had no time to look at
	  (nviz/ and most of ps.map/ in particular.)

[1] http://www.chiark.greenend.org.uk/%7Ecjwatson/bzr/man-db/trunk/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: buffers.patch.gz
Type: application/octet-stream
Size: 8074 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20080112/b58d77bd/buffers.patch-0001.obj


More information about the grass-dev mailing list