[GRASS-dev] G_message () family of functions

Markus Neteler neteler at osgeo.org
Sat Jan 26 08:44:40 EST 2008


Ivan,

before your libgis patch gets lost: should it be applied?
According to Glynn it looked reasonable AFAIK.

Please send it to me (maybe offlist) for inclusion.

Markus

On Jan 14, 2008 1:06 AM, Glynn Clements <glynn at gclements.plus.com> wrote:
>
> Ivan Shmakov wrote:
>
> >  > BTW, the correct pattern for issuing a string message is:
> >
> >  > G_message ("%s", string);
> >
> >  > not:
> >
> >  > G_message (string);
> >
> >  > [...]
> >
> >       May I suggest the following patch?
>
> Seems reasonable enough.
>
> > --- lib/gis/error.c   2008-01-03 14:15:58.000000000 +0600
> > +++ lib/gis/error.c   2008-01-12 23:14:50.000000000 +0600
> > @@ -93,6 +93,16 @@
> >                          time_t, const char *);
> >  static int log_error (const char *, int);
> >
> > +static int
> > +vfprint_error (int type, const char *template, va_list ap)
> > +{
> > +    char buffer[2000];  /* G_asprintf does not work */
> > +
> > +    vsprintf (buffer, template, ap);
>
> It would be nice to use vsnprintf(), but we would need to check that
> it's available (it's not in C89).
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>



-- 
Open Source Geospatial Foundation
http://www.osgeo.org/
http://www.grassbook.org/


More information about the grass-dev mailing list