]> git.pld-linux.org Git - packages/grass.git/blame - grass-format.patch
upgraded to 6.4.4
[packages/grass.git] / grass-format.patch
CommitLineData
705853b0
TP
1From 76422f2e4f2ee7defabbf866688051307a20d0f7 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu@fedoraproject.org>
3Date: Sun, 10 Aug 2014 06:27:58 +0200
4Subject: [PATCH 4/4] Eliminate -Werror=format-string-security issues.
5
6---
7 db/drivers/dbf/column.c | 2 +-
8 display/d.colors/main.c | 4 +-
9 display/d.erase/main.c | 2 +-
10 display/d.save/main.c | 2 +-
11 display/d.what.vect/what.c | 2 +-
12 general/g.mapset/main.c | 2 +-
13 general/g.setproj/get_stp.c | 2 +-
14 general/g.setproj/main.c | 6 +-
15 imagery/i.landsat.toar/landsat_met.c | 4 +-
16 imagery/i.ortho.photo/i.photo.2image/target.c | 2 +-
17 imagery/i.ortho.photo/i.photo.2target/target.c | 2 +-
18 .../i.ortho.photo/i.photo.camera/mod_cam_info.c | 2 +-
19 imagery/i.ortho.photo/i.photo.elev/ask_elev.c | 4 +-
20 imagery/i.ortho.photo/i.photo.elev/main.c | 2 +-
21 imagery/i.ortho.photo/i.photo.rectify/cp.c | 4 +-
22 imagery/i.ortho.photo/i.photo.rectify/target.c | 2 +-
23 imagery/i.ortho.photo/libes/camera.c | 3 +-
24 imagery/i.ortho.photo/libes/conz_points.c | 18 ++--
25 imagery/i.ortho.photo/libes/fopen_camera.c | 5 +-
26 imagery/i.ortho.photo/libes/init_info.c | 11 +--
27 imagery/i.ortho.photo/libes/m_mult.c | 2 +-
28 imagery/i.ortho.photo/libes/open_camera.c | 5 +-
29 imagery/i.ortho.photo/libes/ref_points.c | 11 +--
30 imagery/i.ortho.photo/menu/target.c | 2 +-
31 imagery/i.pca/support.c | 3 +-
32 imagery/i.points/target.c | 2 +-
33 imagery/i.rectify/cp.c | 2 +-
34 imagery/i.rectify/target.c | 2 +-
35 imagery/i.vpoints/analyze.c | 4 +-
36 imagery/i.vpoints/target.c | 2 +-
37 lib/db/dbmi_base/login.c | 2 +-
38 lib/db/dbmi_client/delete_tab.c | 2 +-
39 lib/driver/command.c | 2 +-
40 lib/g3d/g3derror.c | 2 +-
41 lib/g3d/g3drange.c | 3 +-
42 lib/g3d/g3dwindowio.c | 2 +-
43 lib/gis/get_cellhd.c | 4 +-
44 lib/gis/get_datum_name.c | 8 +-
45 lib/gis/get_ellipse.c | 2 +-
46 lib/gis/history.c | 3 +-
47 lib/gis/null_val.c | 2 +-
48 lib/gis/put_cellhd.c | 5 +-
49 lib/gis/put_title.c | 16 ++--
50 lib/gis/quant_io.c | 6 +-
51 lib/gis/quant_rw.c | 26 ++----
52 lib/gis/range.c | 15 ++--
53 lib/gis/seek.c | 6 +-
54 lib/gmath/la.c | 98 +++++++++++-----------
55 lib/proj/datum.c | 4 +-
56 lib/proj/get_proj.c | 2 +-
57 lib/raster/io_sock.c | 22 ++---
58 lib/sites/sites.c | 2 +-
59 lib/symbol/read.c | 2 +-
60 lib/vector/Vlib/open.c | 4 +-
61 raster/r.describe/describe.c | 2 +-
62 raster/r.external/main.c | 2 +-
63 raster/r.flow/mem.h | 8 +-
64 raster/r.in.arc/gethead.c | 4 +-
65 raster/r.in.ascii/gethead.c | 2 +-
66 raster/r.in.gdal/main.c | 4 +-
67 raster/r.in.mat/main.c | 6 +-
68 raster/r.in.xyz/main.c | 2 +-
69 raster/r.le/r.le.patch/driver.c | 5 +-
70 raster/r.out.vrml/main.c | 23 ++---
71 raster/r.profile/main.c | 2 +-
72 raster/r.profile/read_rast.c | 6 +-
73 raster/r.quant/main.c | 16 ++--
74 raster/r.quant/read_rules.c | 7 +-
75 raster/r.random.surface/init.c | 4 +-
76 raster/r.reclass/main.c | 2 +-
77 raster/r.resamp.rst/main.c | 2 +-
78 raster/r.rescale.eq/main.c | 4 +-
79 raster/r.rescale/main.c | 4 +-
80 raster/r.surf.contour/bseg_get.c | 4 +-
81 raster/r.surf.contour/bseg_put.c | 7 +-
82 raster/r.surf.contour/bseg_read.c | 7 +-
83 raster/r.surf.contour/dseg_read.c | 10 +--
84 raster/r.surf.contour/dseg_write.c | 7 +-
85 raster/r.to.rast3/main.c | 6 +-
86 raster/r.to.rast3elev/main.c | 2 +-
87 raster/r.to.vect/areas_io.c | 2 +-
88 raster/r.to.vect/main.c | 4 +-
89 raster/r.to.vect/util.c | 2 +-
90 raster/r.volume/main.c | 2 +-
91 raster/r.water.outlet/legal.c | 4 +-
92 raster/r.water.outlet/main.c | 2 +-
93 raster/r.watershed/seg/bseg_read.c | 7 +-
94 raster/r.watershed/seg/cseg_read.c | 10 +--
95 raster/r.watershed/seg/dseg_read.c | 10 +--
96 raster/r.what/die.c | 2 +-
97 raster/wildfire/r.spread/collect_ori.c | 4 +-
98 raster3d/r3.cross.rast/main.c | 2 +-
99 raster3d/r3.in.ascii/main.c | 2 +-
100 raster3d/r3.in.v5d/main.c | 2 +-
101 raster3d/r3.out.ascii/main.c | 2 +-
102 raster3d/r3.out.v5d/main.c | 2 +-
103 raster3d/r3.to.rast/main.c | 2 +-
104 vector/v.convert/att.c | 4 +-
105 vector/v.in.ascii/in.c | 2 +-
106 vector/v.in.ascii/points.c | 2 +-
107 vector/v.in.dwg/entity.c | 2 +-
108 vector/v.in.dwg/main.c | 4 +-
109 vector/v.in.ogr/main.c | 6 +-
110 vector/v.in.sites/main.c | 4 +-
111 vector/v.net.allpairs/main.c | 4 +-
112 vector/v.net.centrality/main.c | 2 +-
113 vector/v.net.components/main.c | 4 +-
114 vector/v.net.distance/main.c | 4 +-
115 vector/v.net.flow/main.c | 4 +-
116 vector/v.net.path/path.c | 4 +-
117 vector/v.net.timetable/main.c | 6 +-
118 vector/v.overlay/area_area.c | 2 +-
119 vector/v.overlay/line_area.c | 2 +-
120 vector/v.overlay/main.c | 2 +-
121 vector/v.random/main.c | 4 +-
122 vector/v.surf.rst/main.c | 4 +-
123 vector/v.vol.rst/main.c | 2 +-
124 vector/v.vol.rst/user4.c | 2 +-
125 vector/v.vol.rst/vector.c | 2 +-
126 vector/v.what.rast/main.c | 4 +-
127 120 files changed, 269 insertions(+), 372 deletions(-)
128
129diff --git a/db/drivers/dbf/column.c b/db/drivers/dbf/column.c
130index c953ee0..2cbe857 100644
131--- a/db/drivers/dbf/column.c
132+++ b/db/drivers/dbf/column.c
133@@ -39,7 +39,7 @@ int add_column(int tab, int type, char *name, int width, int decimals)
134 sprintf(buf, "DBMI-DBF driver: column name '%s'", name);
135 name[DBF_COL_NAME - 1] = '\0';
136 sprintf(buf + strlen(buf), " truncated to '%s'", name);
137- G_warning(buf);
138+ G_warning("%s", buf);
d62d471a
JB
139 }
140
705853b0
TP
141 /* Check if the column exists */
142diff --git a/display/d.colors/main.c b/display/d.colors/main.c
143index 17c6a6d..413ddb1 100644
144--- a/display/d.colors/main.c
145+++ b/display/d.colors/main.c
146@@ -75,14 +75,14 @@ int main(int argc, char **argv)
147 char msg[256];
148
149 sprintf(msg, "Raster file [%s] not available", map->answer);
150- G_fatal_error(msg);
151+ G_fatal_error("%s", msg);
d62d471a 152 }
705853b0
TP
153
154 if (G_raster_map_is_fp(map->answer, mapset)) {
155 sprintf(buff,
156 "Raster file [%s] is floating point! \nd.colors only works with integer maps",
157 map->answer);
158- G_fatal_error(buff);
159+ G_fatal_error("%s", buff);
d62d471a 160 }
d62d471a 161
705853b0
TP
162 /* connect to the driver */
163diff --git a/display/d.erase/main.c b/display/d.erase/main.c
164index dc7c72d..5662b4a 100644
165--- a/display/d.erase/main.c
166+++ b/display/d.erase/main.c
167@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
d62d471a 168
705853b0
TP
169 R_close_driver();
170 if (err)
171- G_fatal_error(err);
172+ G_fatal_error("%s", err);
173
174 exit(0);
d62d471a 175 }
705853b0
TP
176diff --git a/display/d.save/main.c b/display/d.save/main.c
177index 6a2e8e0..7f60ca9 100644
178--- a/display/d.save/main.c
179+++ b/display/d.save/main.c
180@@ -454,7 +454,7 @@ int set_item(char *item, char **list)
181 G_scan_northing(Nstr, &(Mwind->north), proj);
182 G_scan_northing(Sstr, &(Mwind->south), proj);
183 if ((err = G_adjust_Cell_head(Mwind, 1, 1))) {
184- G_fatal_error(err);
185+ G_fatal_error("%s", err);
d62d471a 186 }
705853b0
TP
187 G_format_resolution(Mwind->ew_res, EWRESstr, proj);
188 G_format_resolution(Mwind->ns_res, NSRESstr, proj);
189diff --git a/display/d.what.vect/what.c b/display/d.what.vect/what.c
190index 0b5af4d..5c43fb8 100644
191--- a/display/d.what.vect/what.c
192+++ b/display/d.what.vect/what.c
193@@ -494,7 +494,7 @@ int what(int once, int txt, int terse, int flash, int width, int mwidth,
194 fflush(stdout);
195 if (!txt && !topo) {
196 db_append_string(&html, "</BODY></HTML>");
197- G_debug(3, db_get_string(&html));
198+ G_debug(3, "%s", db_get_string(&html));
199 F_open(title, db_get_string(&html));
d62d471a 200 }
d62d471a 201
705853b0
TP
202diff --git a/general/g.mapset/main.c b/general/g.mapset/main.c
203index 2fe0f49..f04e742 100644
204--- a/general/g.mapset/main.c
205+++ b/general/g.mapset/main.c
206@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
207 G_asprintf(&lock_prog, "%s/etc/lock", G_gisbase());
d62d471a 208
705853b0
TP
209 sprintf(path, "%s/.gislock", mapset_new_path);
210- G_debug(2, path);
211+ G_debug(2, "%s", path);
d62d471a 212
705853b0
TP
213 ret = G_spawn(lock_prog, lock_prog, path, gis_lock, NULL);
214 G_debug(2, "lock result = %d", ret);
215diff --git a/general/g.setproj/get_stp.c b/general/g.setproj/get_stp.c
216index 53d4541..dd3170f 100644
217--- a/general/g.setproj/get_stp.c
218+++ b/general/g.setproj/get_stp.c
219@@ -56,7 +56,7 @@ int get_stp_code(int code, char *string, char *paramfile)
220 fp = fopen(nad27, "r");
221 if (fp == NULL) {
222 sprintf(buff, "Can not open NAD27 file %s", nad27);
223- G_fatal_error(buff);
224+ G_fatal_error("%s", buff);
225 }
226 while (!gotit) {
227 if (fgets(buff, 200, fp) == NULL)
228diff --git a/general/g.setproj/main.c b/general/g.setproj/main.c
229index 4dd5e69..c522f75 100644
230--- a/general/g.setproj/main.c
231+++ b/general/g.setproj/main.c
232@@ -250,9 +250,9 @@ int main(int argc, char *argv[])
233 0))
234 sph_check = ask_datum(datum, dat_ellps, dat_params);
235 else {
236- sprintf(datum, lbuf);
237- sprintf(dat_params, lbufa);
238- sprintf(dat_ellps, G_datum_ellipsoid(i));
239+ sprintf(datum, "%s", lbuf);
240+ sprintf(dat_params, "%s", lbufa);
241+ sprintf(dat_ellps, "%s", G_datum_ellipsoid(i));
242 sph_check = 1;
243 G_message(_("The datum information has not been changed"));
244 }
245diff --git a/imagery/i.landsat.toar/landsat_met.c b/imagery/i.landsat.toar/landsat_met.c
246index 506d719..e6cf055 100644
247--- a/imagery/i.landsat.toar/landsat_met.c
248+++ b/imagery/i.landsat.toar/landsat_met.c
249@@ -384,14 +384,14 @@ void lsat_metadata(char *metafile, lsat_data * lsat)
250 sprintf(key, "Band%dGainSetting", lsat->band[i].code);
251 get_mtldata(mtldata, key, value);
252 if (value[0] == '\0') {
253- G_warning(key);
254+ G_warning("%s", key);
255 continue;
256 }
257 lsat->band[i].gain = atof(value);
258 sprintf(key, "Band%dBiasSetting", lsat->band[i].code);
259 get_mtldata(mtldata, key, value);
260 if (value[0] == '\0') {
261- G_warning(key);
262+ G_warning("%s", key);
263 continue;
264 }
265 lsat->band[i].bias = atof(value);
266diff --git a/imagery/i.ortho.photo/i.photo.2image/target.c b/imagery/i.ortho.photo/i.photo.2image/target.c
267index a5774b2..e4c57d1 100644
268--- a/imagery/i.ortho.photo/i.photo.2image/target.c
269+++ b/imagery/i.ortho.photo/i.photo.2image/target.c
270@@ -46,7 +46,7 @@ int get_target(void)
271 error:
272 strcat(buf, "Please run i.target for group ");
273 strcat(buf, group.name);
274- G_fatal_error(buf);
275+ G_fatal_error("%s", buf);
d62d471a 276
705853b0
TP
277 return -1;
278 }
279diff --git a/imagery/i.ortho.photo/i.photo.2target/target.c b/imagery/i.ortho.photo/i.photo.2target/target.c
280index 85c4008..df4533e 100644
281--- a/imagery/i.ortho.photo/i.photo.2target/target.c
282+++ b/imagery/i.ortho.photo/i.photo.2target/target.c
283@@ -81,7 +81,7 @@ G_sleep (3);
284 strcat (buf, "Please run i.target for block ");
285 strcat (buf, block.name);
286 ****/
287- G_fatal_error(buf);
288+ G_fatal_error("%s", buf);
289 }
d62d471a 290
705853b0
TP
291 int select_current_env(void)
292diff --git a/imagery/i.ortho.photo/i.photo.camera/mod_cam_info.c b/imagery/i.ortho.photo/i.photo.camera/mod_cam_info.c
293index fe737d9..c2e0605 100644
294--- a/imagery/i.ortho.photo/i.photo.camera/mod_cam_info.c
295+++ b/imagery/i.ortho.photo/i.photo.camera/mod_cam_info.c
296@@ -81,7 +81,7 @@ int mod_cam_info(int have_old, struct Ortho_Camera_File_Ref *cam_info)
297 strcpy(next, "end");
298 else
299 sprintf(next, "%d", endfid);
300- sprintf(next_line, next);
301+ sprintf(next_line, "%s", next);
302 V_line(line, " Next:");
303 V_ques(next, 's', line, 34, 5);
304 V_line(line + 2,
305diff --git a/imagery/i.ortho.photo/i.photo.elev/ask_elev.c b/imagery/i.ortho.photo/i.photo.elev/ask_elev.c
306index d27e39e..51e11a4 100644
307--- a/imagery/i.ortho.photo/i.photo.elev/ask_elev.c
308+++ b/imagery/i.ortho.photo/i.photo.elev/ask_elev.c
309@@ -8,7 +8,6 @@
d62d471a 310
705853b0 311 int ask_elev(char *group, char *location, char *mapset)
d62d471a 312 {
705853b0
TP
313- char buf[100];
314 char t1[80];
315 char t2[80];
d62d471a 316
705853b0
TP
317@@ -35,10 +34,9 @@ int ask_elev(char *group, char *location, char *mapset)
318 }
d62d471a 319
705853b0
TP
320 else if ((mapset_elev = G_find_cell(elev_layer, "")) == NULL) {
321- sprintf(buf,
322+ G_warning(
323 "\n\nraster-file %s not found - select another file\n",
324 elev_layer);
325- G_warning(buf);
326 *elev_layer = 0;
327 continue;
328 }
329diff --git a/imagery/i.ortho.photo/i.photo.elev/main.c b/imagery/i.ortho.photo/i.photo.elev/main.c
330index 023ad6c..5e64ebe 100644
331--- a/imagery/i.ortho.photo/i.photo.elev/main.c
332+++ b/imagery/i.ortho.photo/i.photo.elev/main.c
333@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
334 strcat(buf, _("Please select a target for group"));
335 strcat(buf, group);
336 G_suppress_warnings(0);
337- G_fatal_error(buf);
338+ G_fatal_error("%s", buf);
339 }
d62d471a 340
d62d471a 341
705853b0
TP
342diff --git a/imagery/i.ortho.photo/i.photo.rectify/cp.c b/imagery/i.ortho.photo/i.photo.rectify/cp.c
343index b8ec48c..86e5b33 100644
344--- a/imagery/i.ortho.photo/i.photo.rectify/cp.c
345+++ b/imagery/i.ortho.photo/i.photo.rectify/cp.c
346@@ -31,7 +31,7 @@ int get_conz_points(void)
347 default:
348 return 1;
d62d471a 349 }
705853b0
TP
350- G_fatal_error(msg);
351+ G_fatal_error("%s", msg);
352 }
d62d471a 353
705853b0
TP
354 int get_ref_points(void)
355@@ -61,6 +61,6 @@ int get_ref_points(void)
356 default:
357 return 1;
d62d471a 358 }
705853b0
TP
359- G_fatal_error(msg);
360+ G_fatal_error("%s", msg);
361 /* exit(1); shouldn't get here */
362 }
363diff --git a/imagery/i.ortho.photo/i.photo.rectify/target.c b/imagery/i.ortho.photo/i.photo.rectify/target.c
364index 3adf05b..74b8a80 100644
365--- a/imagery/i.ortho.photo/i.photo.rectify/target.c
366+++ b/imagery/i.ortho.photo/i.photo.rectify/target.c
367@@ -31,5 +31,5 @@ int get_target(char *group)
368 sprintf(buf, _("Mapset <%s> in target location <%s> - "), mapset, location);
369 strcat(buf, stat == 0 ? _("permission denied") : _("not found"));
370 error:
371- G_fatal_error(buf);
372+ G_fatal_error("%s", buf);
373 }
374diff --git a/imagery/i.ortho.photo/libes/camera.c b/imagery/i.ortho.photo/libes/camera.c
375index 26e454e..fdf7c99 100644
376--- a/imagery/i.ortho.photo/libes/camera.c
377+++ b/imagery/i.ortho.photo/libes/camera.c
378@@ -33,10 +33,9 @@ int I_get_group_camera(char *group, char *camera)
379 fd = I_fopen_group_camera_old(group);
380 G_suppress_warnings(0);
381 if (!fd) {
382- sprintf(buf,
383+ G_warning(
384 _("Unable to open camera file for group <%s> in mapset <%s>"),
385 group, G_mapset());
d62d471a 386- G_warning(buf);
705853b0 387 return 0;
d62d471a 388 }
705853b0
TP
389 G_getl2(buf, sizeof(buf), fd);
390diff --git a/imagery/i.ortho.photo/libes/conz_points.c b/imagery/i.ortho.photo/libes/conz_points.c
391index cdadb6e..635d4cb 100644
392--- a/imagery/i.ortho.photo/libes/conz_points.c
393+++ b/imagery/i.ortho.photo/libes/conz_points.c
394@@ -96,15 +96,13 @@ int I_write_con_points(FILE * fd, struct Ortho_Control_Points *cp)
395 int I_get_con_points(char *group, struct Ortho_Control_Points *cp)
d62d471a 396 {
705853b0
TP
397 FILE *fd;
398- char msg[100];
d62d471a
JB
399 int stat;
400
705853b0
TP
401 fd = I_fopen_group_file_old(group, POINT_FILE);
402 if (fd == NULL) {
403- sprintf(msg,
404+ G_warning(
405 "unable to open control point (Z) file for group [%s in %s]",
406 group, G_mapset());
407- G_warning(msg);
408 G_sleep(4);
d62d471a
JB
409 return 0;
410 }
705853b0
TP
411@@ -112,9 +110,8 @@ int I_get_con_points(char *group, struct Ortho_Control_Points *cp)
412 stat = I_read_con_points(fd, cp);
413 fclose(fd);
414 if (stat < 0) {
415- sprintf(msg, "bad format in control point file for group [%s in %s]",
416+ G_warning("bad format in control point file for group [%s in %s]",
417 group, G_mapset());
418- G_warning(msg);
419 G_sleep(4);
420 return 0;
d62d471a 421 }
705853b0
TP
422@@ -124,14 +121,12 @@ int I_get_con_points(char *group, struct Ortho_Control_Points *cp)
423 int I_put_con_points(char *group, struct Ortho_Control_Points *cp)
d62d471a 424 {
705853b0
TP
425 FILE *fd;
426- char msg[100];
d62d471a 427
705853b0
TP
428 fd = I_fopen_group_file_new(group, POINT_FILE);
429 if (fd == NULL) {
430- sprintf(msg,
431+ G_warning(
432 "unable to create control point file for group [%s in %s]",
433 group, G_mapset());
434- G_warning(msg);
435 G_sleep(4);
436 return 0;
d62d471a 437 }
705853b0
TP
438@@ -146,17 +141,15 @@ int I_convert_con_points(char *group, struct Ortho_Control_Points *con_cp,
439 double N12[3])
440 {
441 FILE *fd;
442- char msg[100];
443 int i, stat, status;
444 double e1, e2, n1, n2, z1, z2, e0, n0;
d62d471a 445
d62d471a 446
705853b0
TP
447 fd = I_fopen_group_file_old(group, POINT_FILE);
448 if (fd == NULL) {
449- sprintf(msg,
450+ G_warning(
451 "unable to open control point (Z) file for group [%s in %s]",
452 group, G_mapset());
453- G_warning(msg);
454 G_sleep(4);
455 return 0;
456 }
457@@ -164,9 +157,8 @@ int I_convert_con_points(char *group, struct Ortho_Control_Points *con_cp,
458 stat = I_read_con_points(fd, con_cp);
459 fclose(fd);
460 if (stat < 0) {
461- sprintf(msg, "bad format in control point file for group [%s in %s]",
462+ G_warning("bad format in control point file for group [%s in %s]",
463 group, G_mapset());
464- G_warning(msg);
465 G_sleep(4);
466 return 0;
d62d471a 467 }
705853b0
TP
468diff --git a/imagery/i.ortho.photo/libes/fopen_camera.c b/imagery/i.ortho.photo/libes/fopen_camera.c
469index d798e25..7b2c347 100644
470--- a/imagery/i.ortho.photo/libes/fopen_camera.c
471+++ b/imagery/i.ortho.photo/libes/fopen_camera.c
472@@ -54,11 +54,8 @@ FILE *I_fopen_cam_file_old(char *camera)
d62d471a 473
705853b0
TP
474 static int error(char *camera, char *msga, char *msgb)
475 {
476- char buf[100];
477-
478- sprintf(buf, "%s camera file [%s] in [%s %s] %s",
479+ G_warning("%s camera file [%s] in [%s %s] %s",
480 msga, camera, G_location(), G_mapset(), msgb);
481- G_warning(buf);
d62d471a 482
705853b0
TP
483 return 0;
484 }
485diff --git a/imagery/i.ortho.photo/libes/init_info.c b/imagery/i.ortho.photo/libes/init_info.c
486index 0bb1a67..ab0d6d6 100644
487--- a/imagery/i.ortho.photo/libes/init_info.c
488+++ b/imagery/i.ortho.photo/libes/init_info.c
489@@ -94,23 +94,20 @@ int I_write_init_info(FILE * fd, struct Ortho_Camera_Exp_Init *init_info)
490 int I_get_init_info(char *group, struct Ortho_Camera_Exp_Init *init_info)
491 {
492 FILE *fd;
493- char msg[100];
494 int stat;
d62d471a 495
705853b0
TP
496 fd = I_fopen_group_init_old(group);
497 if (fd == NULL) {
498- sprintf(msg, "unable to open camera initial file %s in %s",
499+ G_warning("unable to open camera initial file %s in %s",
500 group, G_mapset());
501- G_warning(msg);
d62d471a
JB
502 return 0;
503 }
504
705853b0
TP
505 stat = I_read_init_info(fd, init_info);
506 fclose(fd);
507 if (stat < 0) {
508- sprintf(msg, "bad format in camera initial file %s in %s",
509+ G_warning("bad format in camera initial file %s in %s",
510 group, G_mapset());
511- G_warning(msg);
512 return 0;
d62d471a 513 }
705853b0
TP
514 return 1;
515@@ -119,13 +116,11 @@ int I_get_init_info(char *group, struct Ortho_Camera_Exp_Init *init_info)
516 int I_put_init_info(char *group, struct Ortho_Camera_Exp_Init *init_info)
517 {
518 FILE *fd;
519- char msg[100];
d62d471a 520
705853b0
TP
521 fd = I_fopen_group_init_new(group);
522 if (fd == NULL) {
523- sprintf(msg, "unable to open camera initial file %s in %s",
524+ G_warning("unable to open camera initial file %s in %s",
525 group, G_mapset());
526- G_warning(msg);
527 return 0;
d62d471a
JB
528 }
529
705853b0
TP
530diff --git a/imagery/i.ortho.photo/libes/m_mult.c b/imagery/i.ortho.photo/libes/m_mult.c
531index 301ebc0..b93a512 100644
532--- a/imagery/i.ortho.photo/libes/m_mult.c
533+++ b/imagery/i.ortho.photo/libes/m_mult.c
534@@ -21,7 +21,7 @@ int m_mult(MATRIX * a, MATRIX * b, MATRIX * c)
535 if (a->ncols != b->nrows) {
536 sprintf(message, "*: matrices not conformable, %d x %d * %d x %d\n",
537 a->nrows, a->ncols, b->nrows, b->ncols);
538- fprintf(stderr, message);
539+ fprintf(stderr, "%s", message);
540 return error(message);
d62d471a
JB
541 }
542
705853b0
TP
543diff --git a/imagery/i.ortho.photo/libes/open_camera.c b/imagery/i.ortho.photo/libes/open_camera.c
544index 30c6184..6b79136 100644
545--- a/imagery/i.ortho.photo/libes/open_camera.c
546+++ b/imagery/i.ortho.photo/libes/open_camera.c
547@@ -46,11 +46,8 @@ int I_open_cam_file_old(char *camera, char *file)
d62d471a 548
705853b0
TP
549 static int camera_error(char *camera, char *file, char *msga, char *msgb)
550 {
551- char buf[100];
552-
553- sprintf(buf, "%sfile [%s] of group [%s in %s]%s",
554+ G_warning("%sfile [%s] of group [%s in %s]%s",
555 msga, file, camera, G_mapset(), msgb);
556- G_warning(buf);
d62d471a 557
705853b0 558 return 0;
d62d471a 559 }
705853b0
TP
560diff --git a/imagery/i.ortho.photo/libes/ref_points.c b/imagery/i.ortho.photo/libes/ref_points.c
561index 6f03e8d..2cc726e 100644
562--- a/imagery/i.ortho.photo/libes/ref_points.c
563+++ b/imagery/i.ortho.photo/libes/ref_points.c
564@@ -88,16 +88,14 @@ int I_write_ref_points(FILE * fd, struct Ortho_Photo_Points *cp)
565 int I_get_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
d62d471a 566 {
705853b0
TP
567 FILE *fd;
568- char msg[100];
569 int stat;
d62d471a 570
705853b0
TP
571 /*fprintf (stderr, "Try to f_open_group_file_old \n"); */
572 fd = I_fopen_group_file_old(groupname, REF_POINT_FILE);
573 if (fd == NULL) {
574- sprintf(msg,
575+ G_warning(
576 "unable to open reference point file for group [%s in %s]",
577 groupname, G_mapset());
578- G_warning(msg);
579 return 0;
d62d471a 580 }
d62d471a 581
705853b0
TP
582@@ -105,10 +103,9 @@ int I_get_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
583 stat = I_read_ref_points(fd, cp);
584 fclose(fd);
585 if (stat < 0) {
586- sprintf(msg,
587+ G_warning(
588 "bad format in reference point file for group [%s in %s]",
589 groupname, G_mapset());
590- G_warning(msg);
591 return 0;
d62d471a 592 }
705853b0
TP
593 return 1;
594@@ -117,14 +114,12 @@ int I_get_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
595 int I_put_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
596 {
597 FILE *fd;
598- char msg[100];
d62d471a 599
705853b0
TP
600 fd = I_fopen_group_file_new(groupname, REF_POINT_FILE);
601 if (fd == NULL) {
602- sprintf(msg,
603+ G_warning(
604 "unable to create reference point file for group [%s in %s]",
605 groupname, G_mapset());
606- G_warning(msg);
607 return 0;
d62d471a
JB
608 }
609
705853b0
TP
610diff --git a/imagery/i.ortho.photo/menu/target.c b/imagery/i.ortho.photo/menu/target.c
611index 60843f2..d590eda 100644
612--- a/imagery/i.ortho.photo/menu/target.c
613+++ b/imagery/i.ortho.photo/menu/target.c
614@@ -34,5 +34,5 @@ int get_target(char *name, struct Cell_head *target_window)
615 sprintf(buf, "Mapset [%s] in target location [%s] - ", mapset, location);
616 strcat(buf, stat == 0 ? "permission denied\n" : "not found\n");
617 error:
618- G_fatal_error(buf);
619+ G_fatal_error("%s", buf);
620 }
621diff --git a/imagery/i.pca/support.c b/imagery/i.pca/support.c
622index 3e83818..67bf600 100644
623--- a/imagery/i.pca/support.c
624+++ b/imagery/i.pca/support.c
625@@ -63,7 +63,8 @@ static void write_history(int bands, char *outname, double **eigmat, double *eig
626 sprintf(tmpa, "[%5.2f%%]", eigval[i] * 100/eigval_total);
627 strcat(tmpeigen, tmpa);
d62d471a 628
705853b0
TP
629- sprintf(hist.edhist[i + 1], tmpeigen);
630+// sprintf(hist.edhist[i + 1], tmpeigen);
631+ strcpy(hist.edhist[i + 1], tmpeigen);
d62d471a 632
705853b0
TP
633 /* write eigen values to stdout */
634 if (first_map)
635diff --git a/imagery/i.points/target.c b/imagery/i.points/target.c
636index da22d8a..92b65d5 100644
637--- a/imagery/i.points/target.c
638+++ b/imagery/i.points/target.c
639@@ -40,7 +40,7 @@ int get_target(void)
640 error:
641 strcat(buf, "Please run i.target for group ");
642 strcat(buf, group.name);
643- G_fatal_error(buf);
644+ G_fatal_error("%s", buf);
645 }
646
647 int select_current_env(void)
648diff --git a/imagery/i.rectify/cp.c b/imagery/i.rectify/cp.c
649index 0a3e4fa..aca5b44 100644
650--- a/imagery/i.rectify/cp.c
651+++ b/imagery/i.rectify/cp.c
652@@ -40,7 +40,7 @@ int get_control_points(char *group, int order /* THIS HAS BEEN ADDED WITH THE CR
653 */
654 return 1;
d62d471a 655 }
705853b0
TP
656- G_fatal_error(msg);
657+ G_fatal_error("%s", msg);
d62d471a 658
705853b0
TP
659 return 0; /* G_fatal_error() calls exit() */
660 }
661diff --git a/imagery/i.rectify/target.c b/imagery/i.rectify/target.c
662index 868db6a..aa4d947 100644
663--- a/imagery/i.rectify/target.c
664+++ b/imagery/i.rectify/target.c
665@@ -34,6 +34,6 @@ int get_target(char *group)
666 error:
667 strcat(buf, _("Please run i.target for group."));
668 strcat(buf, group);
669- G_fatal_error(buf);
670+ G_fatal_error("%s", buf);
671 return 1; /* never reached */
672 }
673diff --git a/imagery/i.vpoints/analyze.c b/imagery/i.vpoints/analyze.c
674index f19a3f4..008dc9e 100644
675--- a/imagery/i.vpoints/analyze.c
676+++ b/imagery/i.vpoints/analyze.c
677@@ -116,11 +116,9 @@ static int delete_mark(void)
678 int delete_control_point(int n)
679 {
680 int i;
681- char msg[80];
d62d471a 682
705853b0
TP
683 if ((n < 0) | (n > group.points.count - 1)) {
684- sprintf(msg, "%d is an invalid control point index value.", n);
685- G_warning(msg);
686+ G_warning("%d is an invalid control point index value.", n);
687 return 1;
d62d471a 688 }
705853b0
TP
689 for (i = n; i < group.points.count - 1; i++) {
690diff --git a/imagery/i.vpoints/target.c b/imagery/i.vpoints/target.c
691index c245b02..7408592 100644
692--- a/imagery/i.vpoints/target.c
693+++ b/imagery/i.vpoints/target.c
694@@ -41,7 +41,7 @@ int get_target(void)
695 error:
696 strcat(buf, "Please run i.target for group ");
697 strcat(buf, group.name);
698- G_fatal_error(buf);
699+ G_fatal_error("%s", buf);
d62d471a 700
705853b0
TP
701 return -1;
702 }
703diff --git a/lib/db/dbmi_base/login.c b/lib/db/dbmi_base/login.c
704index 41b625d..462fb77 100644
705--- a/lib/db/dbmi_base/login.c
706+++ b/lib/db/dbmi_base/login.c
707@@ -95,7 +95,7 @@ int read_file(LOGIN * login)
708 ret, dr, db, usr, pwd);
d62d471a 709
705853b0
TP
710 if (ret < 2) {
711- G_warning(_("Login file corrupted"));
712+ G_warning("%s", _("Login file corrupted"));
713 continue;
714 }
d62d471a 715
705853b0
TP
716diff --git a/lib/db/dbmi_client/delete_tab.c b/lib/db/dbmi_client/delete_tab.c
717index 98c4ab0..cf053c2 100644
718--- a/lib/db/dbmi_client/delete_tab.c
719+++ b/lib/db/dbmi_client/delete_tab.c
720@@ -47,7 +47,7 @@ int db_delete_table(const char *drvname, const char *dbname, const char *tblname
721 db_init_string(&sql);
722 db_set_string(&sql, "drop table ");
723 db_append_string(&sql, tblname);
724- G_debug(3, db_get_string(&sql));
725+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 726
705853b0
TP
727 if (db_execute_immediate(driver, &sql) != DB_OK) {
728 G_warning(_("Unable to drop table: '%s'"),
729diff --git a/lib/driver/command.c b/lib/driver/command.c
730index 479037d..cc8fb44 100644
731--- a/lib/driver/command.c
732+++ b/lib/driver/command.c
733@@ -544,7 +544,7 @@ int get_command(char *c)
734 continue;
735 while (*c == COMMAND_ESC)
736 if (read1(c) != 0) {
737- G_warning(_("Monitor: get_command: Premature EOF"));
738+ G_warning("%s", _("Monitor: get_command: Premature EOF"));
739 return 1; /* EOF */
d62d471a 740 }
705853b0
TP
741 if (*c)
742diff --git a/lib/g3d/g3derror.c b/lib/g3d/g3derror.c
743index 4c3533f..ea07904 100644
744--- a/lib/g3d/g3derror.c
745+++ b/lib/g3d/g3derror.c
746@@ -40,7 +40,7 @@ void G3d_skipError(const char *msg)
747 void G3d_printError(const char *msg)
748 {
749 fprintf(stderr, "ERROR: ");
750- fprintf(stderr, msg);
751+ fprintf(stderr, "%s", msg);
752 fprintf(stderr, "\n");
753 }
d62d471a 754
705853b0
TP
755diff --git a/lib/g3d/g3drange.c b/lib/g3d/g3drange.c
756index ce0b06b..ede6027 100644
757--- a/lib/g3d/g3drange.c
758+++ b/lib/g3d/g3drange.c
759@@ -196,8 +196,7 @@ static int writeRange(const char *name, struct FPRange *range)
d62d471a 760
705853b0
TP
761 error:
762 G_remove(buf, buf2); /* remove the old file with this name */
763- sprintf(buf, "can't write range file for [%s in %s]", name, G_mapset());
764- G_warning(buf);
765+ G_warning("can't write range file for [%s in %s]", name, G_mapset());
766 return -1;
767 }
d62d471a 768
705853b0
TP
769diff --git a/lib/g3d/g3dwindowio.c b/lib/g3d/g3dwindowio.c
770index a1aaa76..1a1cd4c 100644
771--- a/lib/g3d/g3dwindowio.c
772+++ b/lib/g3d/g3dwindowio.c
773@@ -71,7 +71,7 @@ static void G3d_getFullWindowPath(char *path, const char *windowName)
774 windowName++;
d62d471a 775
705853b0
TP
776 if (strchr(windowName, GRASS_DIRSEP) || strchr(windowName, HOST_DIRSEP)) {
777- sprintf(path, windowName);
778+ sprintf(path, "%s", windowName);
779 return;
d62d471a
JB
780 }
781
705853b0
TP
782diff --git a/lib/gis/get_cellhd.c b/lib/gis/get_cellhd.c
783index f015a0f..18197d5 100644
784--- a/lib/gis/get_cellhd.c
785+++ b/lib/gis/get_cellhd.c
786@@ -78,7 +78,7 @@ int G_get_cellhd(const char *name, const char *mapset,
787 sprintf(tail, _("which is missing."));
788 else
789 sprintf(tail, _("whose header file can't be opened."));
790- G_warning(buf);
791+ G_warning("%s", buf);
792 return -1;
793 }
d62d471a 794 }
705853b0 795@@ -112,6 +112,6 @@ int G_get_cellhd(const char *name, const char *mapset,
d62d471a 796
705853b0 797 G_free(err);
d62d471a 798
705853b0
TP
799- G_warning(buf);
800+ G_warning("%s", buf);
801 return -1;
802 }
803diff --git a/lib/gis/get_datum_name.c b/lib/gis/get_datum_name.c
804index c0d0f48..dde8e05 100644
805--- a/lib/gis/get_datum_name.c
806+++ b/lib/gis/get_datum_name.c
807@@ -106,15 +106,15 @@ int G_ask_datum_name(char *datumname, char *ellpsname)
808 /* For a custom datum we need to interactively ask for the ellipsoid */
809 if (G_ask_ellipse_name(ellipse) < 0)
810 return -1;
811- sprintf(ellpsname, ellipse);
812- sprintf(datumname, "custom");
813+ strcpy(ellpsname, ellipse);
814+ strcpy(datumname, "custom");
d62d471a 815 }
705853b0
TP
816 else {
817 /* else can look it up from datum.table */
818 if ((i = G_get_datum_by_name(answer)) < 0)
819 return -1;
820- sprintf(ellpsname, G_datum_ellipsoid(i));
821- sprintf(datumname, G_datum_name(i));
822+ strcpy(ellpsname, G_datum_ellipsoid(i));
823+ strcpy(datumname, G_datum_name(i));
d62d471a
JB
824 }
825
705853b0
TP
826 return 1;
827diff --git a/lib/gis/get_ellipse.c b/lib/gis/get_ellipse.c
828index 04b4dfe..1877aac 100644
829--- a/lib/gis/get_ellipse.c
830+++ b/lib/gis/get_ellipse.c
831@@ -281,7 +281,7 @@ static int read_ellipsoid_table(int fatal)
832 if (fd == NULL) {
833 perror(file);
834 sprintf(buf, _("Unable to open ellipsoid table file <%s>"), file);
835- fatal ? G_fatal_error(buf) : G_warning(buf);
836+ fatal ? G_fatal_error("%s", buf) : G_warning("%s", buf);
837 return 0;
d62d471a
JB
838 }
839
705853b0
TP
840diff --git a/lib/gis/history.c b/lib/gis/history.c
841index 9e25039..4b52b71 100644
842--- a/lib/gis/history.c
843+++ b/lib/gis/history.c
844@@ -270,7 +270,8 @@ int G_command_history(struct History *hist)
d62d471a
JB
845 }
846
705853b0
TP
847 if (cmdlen < 70) { /* ie if it will fit on a single line */
848- sprintf(hist->edhist[hist->edlinecnt], G_recreate_command());
849+// sprintf(hist->edhist[hist->edlinecnt], G_recreate_command());
850+ strcpy(hist->edhist[hist->edlinecnt], G_recreate_command());
851 hist->edlinecnt++;
d62d471a 852 }
705853b0
TP
853 else { /* multi-line required */
854diff --git a/lib/gis/null_val.c b/lib/gis/null_val.c
855index 1f1d59f..ac92aaf 100644
856--- a/lib/gis/null_val.c
857+++ b/lib/gis/null_val.c
858@@ -112,7 +112,7 @@ static void InitError(void)
859 strcpy(errMsg, _("Null values have not been initialized. "));
860 strcat(errMsg, _("G_gisinit() must be called first. "));
861 strcat(errMsg, _("Please advise GRASS developers of this error.\n"));
862- G_fatal_error(errMsg);
863+ G_fatal_error("%s", errMsg);
d62d471a 864
705853b0
TP
865 return;
866 }
867diff --git a/lib/gis/put_cellhd.c b/lib/gis/put_cellhd.c
868index 1500ce3..747dfa0 100644
869--- a/lib/gis/put_cellhd.c
870+++ b/lib/gis/put_cellhd.c
871@@ -21,10 +21,7 @@ int G_put_cellhd(const char *name, struct Cell_head *cellhd)
872 FILE *fd;
873
874 if (!(fd = G_fopen_new("cellhd", name))) {
875- char buf[1024];
876-
877- sprintf(buf, _("Unable to create header file for [%s]"), name);
878- G_warning(buf);
879+ G_warning(_("Unable to create header file for [%s]"), name);
880 return -1;
d62d471a
JB
881 }
882
705853b0
TP
883diff --git a/lib/gis/put_title.c b/lib/gis/put_title.c
884index 36dab0a..41ff3ef 100644
885--- a/lib/gis/put_title.c
886+++ b/lib/gis/put_title.c
887@@ -25,10 +25,8 @@ int G_put_cell_title(const char *name, const char *title)
888 in = out = 0;
889 in = G_fopen_old("cats", name, mapset);
890 if (!in) {
891- sprintf(buf,
892- _("category information for [%s] in [%s] missing or invalid"),
893+ G_warning(_("category information for [%s] in [%s] missing or invalid"),
894 name, mapset);
895- G_warning(buf);
896 return -1;
897 }
d62d471a 898
705853b0
TP
899@@ -36,8 +34,7 @@ int G_put_cell_title(const char *name, const char *title)
900 out = fopen(tempfile, "w");
901 if (!out) {
902 fclose(in);
903- sprintf(buf, _("G_put_title - can't create a temp file"));
904- G_warning(buf);
905+ G_warning(_("G_put_title - can't create a temp file"));
906 return -1;
d62d471a
JB
907 }
908
705853b0 909@@ -53,25 +50,22 @@ int G_put_cell_title(const char *name, const char *title)
d62d471a 910
705853b0
TP
911 /* must be #cats line, title line, and label for cat 0 */
912 if (line < 3) {
913- sprintf(buf, _("category information for [%s] in [%s] invalid"), name,
914+ G_warning(_("category information for [%s] in [%s] invalid"), name,
915 mapset);
916- G_warning(buf);
917 return -1;
d62d471a
JB
918 }
919
705853b0
TP
920 in = fopen(tempfile, "r");
921 if (!in) {
922- sprintf(buf, _("G_put_title - can't reopen temp file"));
923- G_warning(buf);
924+ G_warning(_("G_put_title - can't reopen temp file"));
925 return -1;
d62d471a
JB
926 }
927
705853b0
TP
928 out = G_fopen_new("cats", name);
929 if (!out) {
930 fclose(in);
931- sprintf(buf, _("can't write category information for [%s] in [%s]"),
932+ G_warning(_("can't write category information for [%s] in [%s]"),
933 name, mapset);
934- G_warning(buf);
935 return -1;
d62d471a
JB
936 }
937
705853b0
TP
938diff --git a/lib/gis/quant_io.c b/lib/gis/quant_io.c
939index 15205ef..fbe2491 100644
940--- a/lib/gis/quant_io.c
941+++ b/lib/gis/quant_io.c
942@@ -121,10 +121,9 @@ int G__quant_import(const char *name, const char *mapset, struct Quant *quant)
943 G_quant_free(quant);
d62d471a 944
705853b0
TP
945 if (G_raster_map_type(name, mapset) == CELL_TYPE) {
946- sprintf(buf,
947+ G_warning(
948 "G__quant_import: attempt to open quantization table for CELL_TYPE file [%s] in mapset {%s]",
949 name, mapset);
950- G_warning(buf);
951 return -2;
d62d471a 952 }
d62d471a 953
705853b0
TP
954@@ -164,9 +163,8 @@ int G__quant_import(const char *name, const char *mapset, struct Quant *quant)
955 err = "empty";
d62d471a 956 }
d62d471a 957
705853b0
TP
958- sprintf(buf,
959+ G_warning(
960 _("quantization file [%s] in mapset [%s] %s"), name, mapset, err);
961- G_warning(buf);
d62d471a 962
705853b0
TP
963 return 0;
964 }
965diff --git a/lib/gis/quant_rw.c b/lib/gis/quant_rw.c
966index 2b7bf1b..4c069a8 100644
967--- a/lib/gis/quant_rw.c
968+++ b/lib/gis/quant_rw.c
969@@ -63,16 +63,14 @@
d62d471a 970
705853b0
TP
971 int G_truncate_fp_map(const char *name, const char *mapset)
972 {
973- char buf[300];
974 struct Quant quant;
d62d471a 975
705853b0
TP
976 G_quant_init(&quant);
977 G_quant_truncate(&quant);
978 /* quantize the map */
979 if (G_write_quant(name, mapset, &quant) < 0) {
980- sprintf(buf, "G_truncate_fp_map: can't write quant rules for map %s",
981+ G_warning("G_truncate_fp_map: can't write quant rules for map %s",
982 name);
983- G_warning(buf);
984 return -1;
985 }
986 return 1;
987@@ -80,16 +78,14 @@ int G_truncate_fp_map(const char *name, const char *mapset)
d62d471a 988
705853b0
TP
989 int G_round_fp_map(const char *name, const char *mapset)
990 {
991- char buf[300];
992 struct Quant quant;
d62d471a 993
705853b0
TP
994 G_quant_init(&quant);
995 G_quant_round(&quant);
996 /* round the map */
997 if (G_write_quant(name, mapset, &quant) < 0) {
998- sprintf(buf, "G_truncate_fp_map: can't write quant rules for map %s",
999+ G_warning("G_truncate_fp_map: can't write quant rules for map %s",
1000 name);
1001- G_warning(buf);
1002 return -1;
d62d471a 1003 }
705853b0
TP
1004 return 1;
1005@@ -113,20 +109,17 @@ int G_round_fp_map(const char *name, const char *mapset)
1006 int G_quantize_fp_map(const char *name, const char *mapset,
1007 CELL min, CELL max)
1008 {
1009- char buf[300];
1010 DCELL d_min, d_max;
1011 struct FPRange fp_range;
d62d471a 1012
705853b0
TP
1013 if (G_read_fp_range(name, mapset, &fp_range) < 0) {
1014- sprintf(buf, "G_quantize_fp_map: can't read fp range for map %s",
1015+ G_warning("G_quantize_fp_map: can't read fp range for map %s",
1016 name);
1017- G_warning(buf);
1018 return -1;
d62d471a 1019 }
705853b0
TP
1020 G_get_fp_range_min_max(&fp_range, &d_min, &d_max);
1021 if (G_is_d_null_value(&d_min) || G_is_d_null_value(&d_max)) {
1022- sprintf(buf, "G_quantize_fp_map: raster map %s is empty", name);
1023- G_warning(buf);
1024+ G_warning("G_quantize_fp_map: raster map %s is empty", name);
1025 return -1;
1026 }
1027 return G_quantize_fp_map_range(name, mapset, d_min, d_max, min, max);
1028@@ -159,17 +152,15 @@ int G_quantize_fp_map(const char *name, const char *mapset,
1029 int G_quantize_fp_map_range(const char *name, const char *mapset,
1030 DCELL d_min, DCELL d_max, CELL min, CELL max)
1031 {
1032- char buf[300];
1033 struct Quant quant;
d62d471a 1034
705853b0
TP
1035 G_quant_init(&quant);
1036 G_quant_add_rule(&quant, d_min, d_max, min, max);
1037 /* quantize the map */
1038 if (G_write_quant(name, mapset, &quant) < 0) {
1039- sprintf(buf,
1040+ G_warning(
1041 "G_quantize_fp_map_range: can't write quant rules for map %s",
1042 name);
1043- G_warning(buf);
1044 return -1;
1045 }
1046 return 1;
1047@@ -200,11 +191,9 @@ int G_write_quant(const char *name, const char *mapset,
1048 {
1049 CELL cell_min, cell_max;
1050 DCELL d_min, d_max;
1051- char buf[300];
d62d471a 1052
705853b0
TP
1053 if (G_raster_map_type(name, mapset) == CELL_TYPE) {
1054- sprintf(buf, _("Cannot write quant rules: map %s is integer"), name);
1055- G_warning(buf);
1056+ G_warning(_("Cannot write quant rules: map %s is integer"), name);
1057 return -1;
d62d471a
JB
1058 }
1059
705853b0 1060@@ -212,8 +201,7 @@ int G_write_quant(const char *name, const char *mapset,
d62d471a 1061
705853b0
TP
1062 /* first actually write the rules */
1063 if (G__quant_export(name, mapset, quant) < 0) {
1064- sprintf(buf, _("Cannot write quant rules for map %s"), name);
1065- G_warning(buf);
1066+ G_warning(_("Cannot write quant rules for map %s"), name);
1067 return -1;
d62d471a
JB
1068 }
1069
705853b0
TP
1070diff --git a/lib/gis/range.c b/lib/gis/range.c
1071index ebd8232..a0f4dab 100644
1072--- a/lib/gis/range.c
1073+++ b/lib/gis/range.c
1074@@ -189,8 +189,7 @@ int G_read_fp_range(const char *name, const char *mapset,
1075 error:
1076 if (fd > 0)
1077 close(fd);
1078- sprintf(buf, _("can't read f_range file for [%s in %s]"), name, mapset);
1079- G_warning(buf);
1080+ G_warning(buf, _("can't read f_range file for [%s in %s]"), name, mapset);
1081 return -1;
1082 }
d62d471a 1083
705853b0
TP
1084@@ -240,10 +239,9 @@ int G_read_range(const char *name, const char *mapset, struct Range *range)
1085 DCELL dmin, dmax;
d62d471a 1086
705853b0
TP
1087 if (G_read_quant(name, mapset, &quant) < 0) {
1088- sprintf(buf,
1089+ G_warning(buf,
1090 "G_read_range(): can't read quant rules for fp map %s@%s",
1091 name, mapset);
1092- G_warning(buf);
1093 return -1;
1094 }
1095 if (G_quant_is_truncate(&quant) || G_quant_is_round(&quant)) {
1096@@ -305,8 +303,7 @@ int G_read_range(const char *name, const char *mapset, struct Range *range)
1097 error:
1098 if (fd)
1099 fclose(fd);
1100- sprintf(buf, _("can't read range file for [%s in %s]"), name, mapset);
1101- G_warning(buf);
1102+ G_warning(_("can't read range file for [%s in %s]"), name, mapset);
1103 return -1;
1104 }
d62d471a 1105
705853b0 1106@@ -356,9 +353,8 @@ int G_write_range(const char *name, const struct Range *range)
d62d471a 1107
705853b0
TP
1108 error:
1109 G_remove_misc("cell_misc", "range", name); /* remove the old file with this name */
1110- sprintf(buf, _("can't write range file for [%s in %s]"),
1111+ G_warning(_("can't write range file for [%s in %s]"),
1112 name, G_mapset());
1113- G_warning(buf);
1114 return -1;
1115 }
d62d471a 1116
705853b0 1117@@ -409,9 +405,8 @@ int G_write_fp_range(const char *name, const struct FPRange *range)
d62d471a 1118
705853b0
TP
1119 error:
1120 G_remove(buf, "f_range"); /* remove the old file with this name */
1121- sprintf(buf, _("can't write range file for [%s in %s]"),
1122+ G_warning(_("can't write range file for [%s in %s]"),
1123 name, G_mapset());
1124- G_warning(buf);
1125 return -1;
1126 }
d62d471a 1127
705853b0
TP
1128diff --git a/lib/gis/seek.c b/lib/gis/seek.c
1129index 747e103..e0a928a 100644
1130--- a/lib/gis/seek.c
1131+++ b/lib/gis/seek.c
1132@@ -49,12 +49,12 @@ void G_fseek(FILE *fp, off_t offset, int whence)
1133 {
1134 #ifdef HAVE_FSEEKO
1135 if (fseeko(fp, offset, whence) != 0)
1136- G_fatal_error(_("Unable to seek"));
1137+ G_fatal_error("%s", _("Unable to seek"));
1138 #else
1139 long loff = (long) offset;
1140 if ((off_t) loff != offset)
1141- G_fatal_error(_("Seek offset out of range"));
1142+ G_fatal_error("%s", _("Seek offset out of range"));
1143 if (fseek(fp, loff, whence) != 0)
1144- G_fatal_error(_("Unable to seek"));
1145+ G_fatal_error("%s", _("Unable to seek"));
1146 #endif
1147 }
1148diff --git a/lib/gmath/la.c b/lib/gmath/la.c
1149index 7ca37c4..3205bfe 100644
1150--- a/lib/gmath/la.c
1151+++ b/lib/gmath/la.c
1152@@ -57,7 +57,7 @@ mat_struct *G_matrix_init(int rows, int cols, int ldim)
1153 mat_struct *tmp_arry;
d62d471a 1154
705853b0
TP
1155 if (rows < 1 || cols < 1 || ldim < rows) {
1156- G_warning(_("Matrix dimensions out of range"));
1157+ G_warning("%s", _("Matrix dimensions out of range"));
1158 return NULL;
1159 }
d62d471a 1160
705853b0
TP
1161@@ -113,7 +113,7 @@ int G_matrix_zero(mat_struct * A)
1162 int G_matrix_set(mat_struct * A, int rows, int cols, int ldim)
d62d471a 1163 {
705853b0
TP
1164 if (rows < 1 || cols < 1 || ldim < 0) {
1165- G_warning(_("Matrix dimensions out of range"));
1166+ G_warning("%s", _("Matrix dimensions out of range"));
1167 return -1;
d62d471a
JB
1168 }
1169
705853b0
TP
1170@@ -146,12 +146,12 @@ mat_struct *G_matrix_copy(const mat_struct * A)
1171 mat_struct *B;
d62d471a 1172
705853b0
TP
1173 if (!A->is_init) {
1174- G_warning(_("Matrix is not initialised fully."));
1175+ G_warning("%s", _("Matrix is not initialised fully."));
1176 return NULL;
d62d471a 1177 }
d62d471a 1178
705853b0
TP
1179 if ((B = G_matrix_init(A->rows, A->cols, A->ldim)) == NULL) {
1180- G_warning(_("Unable to allocate space for matrix copy"));
1181+ G_warning("%s", _("Unable to allocate space for matrix copy"));
1182 return NULL;
1183 }
d62d471a 1184
705853b0
TP
1185@@ -240,13 +240,13 @@ mat_struct *G__matrix_add(mat_struct * mt1, mat_struct * mt2, const double c1,
1186 int i, j; /* loop variables */
d62d471a 1187
705853b0
TP
1188 if (c1 == 0) {
1189- G_warning(_("First scalar multiplier must be non-zero"));
1190+ G_warning("%s", _("First scalar multiplier must be non-zero"));
1191 return NULL;
1192 }
d62d471a 1193
705853b0
TP
1194 if (c2 == 0) {
1195 if (!mt1->is_init) {
1196- G_warning(_("One or both input matrices uninitialised"));
1197+ G_warning("%s", _("One or both input matrices uninitialised"));
1198 return NULL;
1199 }
1200 }
1201@@ -254,18 +254,18 @@ mat_struct *G__matrix_add(mat_struct * mt1, mat_struct * mt2, const double c1,
1202 else {
d62d471a 1203
705853b0
TP
1204 if (!((mt1->is_init) && (mt2->is_init))) {
1205- G_warning(_("One or both input matrices uninitialised"));
1206+ G_warning("%s", _("One or both input matrices uninitialised"));
1207 return NULL;
1208 }
d62d471a 1209
705853b0
TP
1210 if (mt1->rows != mt2->rows || mt1->cols != mt2->cols) {
1211- G_warning(_("Matrix order does not match"));
1212+ G_warning("%s", _("Matrix order does not match"));
1213 return NULL;
1214 }
d62d471a
JB
1215 }
1216
705853b0
TP
1217 if ((mt3 = G_matrix_init(mt1->rows, mt1->cols, mt1->ldim)) == NULL) {
1218- G_warning(_("Unable to allocate space for matrix sum"));
1219+ G_warning("%s", _("Unable to allocate space for matrix sum"));
1220 return NULL;
d62d471a
JB
1221 }
1222
705853b0
TP
1223@@ -319,17 +319,17 @@ mat_struct *G_matrix_product(mat_struct * mt1, mat_struct * mt2)
1224 integer1 no_trans = 'n';
1225
1226 if (!((mt1->is_init) || (mt2->is_init))) {
1227- G_warning(_("One or both input matrices uninitialised"));
1228+ G_warning("%s", _("One or both input matrices uninitialised"));
1229 return NULL;
d62d471a 1230 }
d62d471a 1231
705853b0
TP
1232 if (mt1->cols != mt2->rows) {
1233- G_warning(_("Matrix order does not match"));
1234+ G_warning("%s", _("Matrix order does not match"));
1235 return NULL;
d62d471a
JB
1236 }
1237
705853b0
TP
1238 if ((mt3 = G_matrix_init(mt1->rows, mt2->cols, mt1->ldim)) == NULL) {
1239- G_warning(_("Unable to allocate space for matrix product"));
1240+ G_warning("%s", _("Unable to allocate space for matrix product"));
1241 return NULL;
d62d471a
JB
1242 }
1243
705853b0
TP
1244@@ -441,29 +441,29 @@ G_matrix_LU_solve(const mat_struct * mt1, mat_struct ** xmat0,
1245 mat_struct *wmat, *xmat, *mtx;
d62d471a 1246
705853b0
TP
1247 if (mt1->is_init == 0 || bmat->is_init == 0) {
1248- G_warning(_("Input: one or both data matrices uninitialised"));
1249+ G_warning("%s", _("Input: one or both data matrices uninitialised"));
1250 return -1;
d62d471a
JB
1251 }
1252
705853b0
TP
1253 if (mt1->rows != mt1->cols || mt1->rows < 1) {
1254- G_warning(_("Principal matrix is not properly dimensioned"));
1255+ G_warning("%s", _("Principal matrix is not properly dimensioned"));
1256 return -1;
d62d471a
JB
1257 }
1258
705853b0
TP
1259 if (bmat->cols < 1) {
1260- G_warning(_("Input: you must have at least one array to solve"));
1261+ G_warning("%s", _("Input: you must have at least one array to solve"));
1262 return -1;
1263 }
d62d471a 1264
705853b0
TP
1265 /* Now create solution matrix by copying the original coefficient matrix */
1266 if ((xmat = G_matrix_copy(bmat)) == NULL) {
1267- G_warning(_("Could not allocate space for solution matrix"));
1268+ G_warning("%s", _("Could not allocate space for solution matrix"));
1269 return -1;
1270 }
d62d471a 1271
705853b0
TP
1272 /* Create working matrix for the coefficient array */
1273 if ((mtx = G_matrix_copy(mt1)) == NULL) {
1274- G_warning(_("Could not allocate space for working matrix"));
1275+ G_warning("%s", _("Could not allocate space for working matrix"));
1276 return -1;
1277 }
d62d471a 1278
705853b0
TP
1279@@ -471,7 +471,7 @@ G_matrix_LU_solve(const mat_struct * mt1, mat_struct ** xmat0,
1280 original information
1281 */
1282 if ((wmat = G_matrix_copy(bmat)) == NULL) {
1283- G_warning(_("Could not allocate space for working matrix"));
1284+ G_warning("%s", _("Could not allocate space for working matrix"));
1285 return -1;
d62d471a
JB
1286 }
1287
705853b0
TP
1288@@ -524,18 +524,18 @@ G_matrix_LU_solve(const mat_struct * mt1, mat_struct ** xmat0,
1289 G_matrix_free(mtx);
1290
1291 if (res_info > 0) {
1292- G_warning(_("Matrix (or submatrix is singular). Solution undetermined"));
1293+ G_warning("%s", _("Matrix (or submatrix is singular). Solution undetermined"));
1294 return 1;
1295 }
1296 else if (res_info < 0) {
1297- G_warning(_("Problem in LA routine."));
1298+ G_warning("%s", _("Problem in LA routine."));
1299 return -1;
1300 }
1301 break;
1302 }
1303 default:
1304 {
1305- G_warning(_("Procedure not yet available for selected matrix type"));
1306+ G_warning("%s", _("Procedure not yet available for selected matrix type"));
1307 return -1;
d62d471a 1308 }
705853b0
TP
1309 } /* end switch */
1310@@ -569,12 +569,12 @@ mat_struct *G_matrix_inverse(mat_struct * mt)
1311 int i, j, k; /* loop */
d62d471a 1312
705853b0
TP
1313 if (mt->rows != mt->cols) {
1314- G_warning(_("Matrix is not square. Cannot determine inverse"));
1315+ G_warning("%s", _("Matrix is not square. Cannot determine inverse"));
1316 return NULL;
d62d471a 1317 }
d62d471a 1318
705853b0
TP
1319 if ((mt0 = G_matrix_init(mt->rows, mt->rows, mt->ldim)) == NULL) {
1320- G_warning(_("Unable to allocate space for matrix"));
1321+ G_warning("%s", _("Unable to allocate space for matrix"));
1322 return NULL;
1323 }
d62d471a 1324
705853b0 1325@@ -591,12 +591,12 @@ mat_struct *G_matrix_inverse(mat_struct * mt)
d62d471a 1326
705853b0
TP
1327 /* Solve system */
1328 if ((k = G_matrix_LU_solve(mt, &res, mt0, NONSYM)) == 1) {
1329- G_warning(_("Matrix is singular"));
1330+ G_warning("%s", _("Matrix is singular"));
1331 G_matrix_free(mt0);
1332 return NULL;
d62d471a 1333 }
705853b0
TP
1334 else if (k < 0) {
1335- G_warning(_("Problem in LA procedure."));
1336+ G_warning("%s", _("Problem in LA procedure."));
1337 G_matrix_free(mt0);
1338 return NULL;
1339 }
1340@@ -684,12 +684,12 @@ void G_matrix_print(mat_struct * mt)
1341 int G_matrix_set_element(mat_struct * mt, int rowval, int colval, double val)
1342 {
1343 if (!mt->is_init) {
1344- G_warning(_("Element array has not been allocated"));
1345+ G_warning("%s", _("Element array has not been allocated"));
1346 return -1;
d62d471a 1347 }
d62d471a 1348
705853b0
TP
1349 if (rowval >= mt->rows || colval >= mt->cols || rowval < 0 || colval < 0) {
1350- G_warning(_("Specified element is outside array bounds"));
1351+ G_warning("%s", _("Specified element is outside array bounds"));
1352 return -1;
d62d471a 1353 }
d62d471a 1354
705853b0
TP
1355@@ -743,17 +743,17 @@ vec_struct *G_matvect_get_column(mat_struct * mt, int col)
1356 vec_struct *vc1;
d62d471a 1357
705853b0
TP
1358 if (col < 0 || col >= mt->cols) {
1359- G_warning(_("Specified matrix column index is outside range"));
1360+ G_warning("%s", _("Specified matrix column index is outside range"));
1361 return NULL;
d62d471a
JB
1362 }
1363
705853b0
TP
1364 if (!mt->is_init) {
1365- G_warning(_("Matrix is not initialised"));
1366+ G_warning("%s", _("Matrix is not initialised"));
1367 return NULL;
1368 }
d62d471a 1369
705853b0
TP
1370 if ((vc1 = G_vector_init(mt->rows, mt->ldim, CVEC)) == NULL) {
1371- G_warning(_("Could not allocate space for vector structure"));
1372+ G_warning("%s", _("Could not allocate space for vector structure"));
1373 return NULL;
1374 }
d62d471a 1375
705853b0
TP
1376@@ -784,17 +784,17 @@ vec_struct *G_matvect_get_row(mat_struct * mt, int row)
1377 vec_struct *vc1;
d62d471a 1378
705853b0
TP
1379 if (row < 0 || row >= mt->cols) {
1380- G_warning(_("Specified matrix row index is outside range"));
1381+ G_warning("%s", _("Specified matrix row index is outside range"));
1382 return NULL;
d62d471a
JB
1383 }
1384
705853b0
TP
1385 if (!mt->is_init) {
1386- G_warning(_("Matrix is not initialised"));
1387+ G_warning("%s", _("Matrix is not initialised"));
1388 return NULL;
d62d471a
JB
1389 }
1390
705853b0
TP
1391 if ((vc1 = G_vector_init(mt->cols, mt->ldim, RVEC)) == NULL) {
1392- G_warning(_("Could not allocate space for vector structure"));
1393+ G_warning("%s", _("Could not allocate space for vector structure"));
1394 return NULL;
d62d471a
JB
1395 }
1396
705853b0
TP
1397@@ -824,12 +824,12 @@ vec_struct *G_matvect_get_row(mat_struct * mt, int row)
1398 int G_matvect_extract_vector(mat_struct * mt, vtype vt, int indx)
1399 {
1400 if (vt == RVEC && indx >= mt->rows) {
1401- G_warning(_("Specified row index is outside range"));
1402+ G_warning("%s", _("Specified row index is outside range"));
1403 return -1;
d62d471a
JB
1404 }
1405
705853b0
TP
1406 else if (vt == CVEC && indx >= mt->cols) {
1407- G_warning(_("Specified column index is outside range"));
1408+ G_warning("%s", _("Specified column index is outside range"));
1409 return -1;
d62d471a
JB
1410 }
1411
705853b0 1412@@ -849,7 +849,7 @@ int G_matvect_extract_vector(mat_struct * mt, vtype vt, int indx)
d62d471a 1413
705853b0
TP
1414 default:
1415 {
1416- G_warning(_("Unknown vector type."));
1417+ G_warning("%s", _("Unknown vector type."));
1418 return -1;
1419 }
d62d471a 1420
705853b0
TP
1421@@ -974,34 +974,34 @@ vec_struct *G_vector_sub(vec_struct * v1, vec_struct * v2, vec_struct * out)
1422 int i;
d62d471a 1423
705853b0
TP
1424 if (!out->is_init) {
1425- G_warning(_("Output vector is uninitialized"));
1426+ G_warning("%s", _("Output vector is uninitialized"));
1427 return NULL;
d62d471a 1428 }
d62d471a 1429
705853b0
TP
1430 if (v1->type != v2->type) {
1431- G_warning(_("Vectors are not of the same type"));
1432+ G_warning("%s", _("Vectors are not of the same type"));
1433 return NULL;
d62d471a
JB
1434 }
1435
705853b0
TP
1436 if (v1->type != out->type) {
1437- G_warning(_("Output vector is of incorrect type"));
1438+ G_warning("%s", _("Output vector is of incorrect type"));
1439 return NULL;
d62d471a 1440 }
d62d471a 1441
705853b0
TP
1442 if (v1->type == MATRIX_) {
1443- G_warning(_("Matrices not allowed"));
1444+ G_warning("%s", _("Matrices not allowed"));
1445 return NULL;
d62d471a
JB
1446 }
1447
705853b0
TP
1448 if ((v1->type == ROWVEC_ && v1->cols != v2->cols) ||
1449 (v1->type == COLVEC_ && v1->rows != v2->rows)) {
1450- G_warning(_("Vectors have differing dimensions"));
1451+ G_warning("%s", _("Vectors have differing dimensions"));
1452 return NULL;
d62d471a
JB
1453 }
1454
705853b0
TP
1455 if ((v1->type == ROWVEC_ && v1->cols != out->cols) ||
1456 (v1->type == COLVEC_ && v1->rows != out->rows)) {
1457- G_warning(_("Output vector has incorrect dimension"));
1458+ G_warning("%s", _("Output vector has incorrect dimension"));
1459 return NULL;
d62d471a
JB
1460 }
1461
705853b0
TP
1462@@ -1047,12 +1047,12 @@ int G_vector_set(vec_struct * A, int cells, int ldim, vtype vt, int vindx)
1463 {
1464 if ((cells < 1) || (vt == RVEC && ldim < 1)
1465 || (vt == CVEC && ldim < cells) || ldim < 0) {
1466- G_warning(_("Vector dimensions out of range"));
1467+ G_warning("%s", _("Vector dimensions out of range"));
1468 return -1;
1469 }
d62d471a 1470
705853b0
TP
1471 if ((vt == RVEC && vindx >= A->cols) || (vt == CVEC && vindx >= A->rows)) {
1472- G_warning(_("Row/column out of range"));
1473+ G_warning("%s", _("Row/column out of range"));
1474 return -1;
1475 }
d62d471a 1476
705853b0
TP
1477@@ -1229,7 +1229,7 @@ double G_vector_norm1(vec_struct * vc)
1478 int i;
d62d471a 1479
705853b0
TP
1480 if (!vc->is_init) {
1481- G_warning(_("Matrix is not initialised"));
1482+ G_warning("%s", _("Matrix is not initialised"));
1483 return 0.0 / 0.0; /* NaN */
d62d471a
JB
1484 }
1485
705853b0
TP
1486@@ -1267,7 +1267,7 @@ vec_struct *G_vector_copy(const vec_struct * vc1, int comp_flag)
1487 int cnt;
d62d471a 1488
705853b0
TP
1489 if (!vc1->is_init) {
1490- G_warning(_("Vector structure is not initialised"));
1491+ G_warning("%s", _("Vector structure is not initialised"));
1492 return NULL;
d62d471a 1493 }
d62d471a 1494
705853b0
TP
1495@@ -1388,7 +1388,7 @@ int G_matrix_read(FILE * fp, mat_struct * out)
1496 }
d62d471a 1497
705853b0
TP
1498 if (sscanf(buff, "Matrix: %d by %d", &rows, &cols) != 2) {
1499- G_warning(_("Input format error"));
1500+ G_warning("%s", _("Input format error"));
1501 return -1;
d62d471a
JB
1502 }
1503
705853b0 1504@@ -1396,12 +1396,12 @@ int G_matrix_read(FILE * fp, mat_struct * out)
d62d471a 1505
705853b0
TP
1506 for (i = 0; i < rows; i++) {
1507 if (fscanf(fp, "row%d:", &row) != 1 || row != i) {
1508- G_warning(_("Input format error"));
1509+ G_warning("%s", _("Input format error"));
1510 return -1;
d62d471a 1511 }
705853b0
TP
1512 for (j = 0; j < cols; j++) {
1513 if (fscanf(fp, "%lf:", &val) != 1) {
1514- G_warning(_("Input format error"));
1515+ G_warning("%s", _("Input format error"));
1516 return -1;
1517 }
d62d471a 1518
705853b0
TP
1519diff --git a/lib/proj/datum.c b/lib/proj/datum.c
1520index 43a3365..dfb8a55 100644
1521--- a/lib/proj/datum.c
1522+++ b/lib/proj/datum.c
1523@@ -320,7 +320,7 @@ int GPJ_ask_datum_params(const char *datumname, char **params)
1524 /* Search through the linked list to find the parameter string
1525 * that corresponds to the number entered */
1526 if (list->count == currenttransform)
1527- G_asprintf(params, list->params);
1528+ G_asprintf(params, "%s", list->params);
d62d471a 1529
705853b0
TP
1530 /* Continue to end of list even after we find it, to free all
1531 * the memory used */
1532@@ -347,7 +347,7 @@ int GPJ_ask_datum_params(const char *datumname, char **params)
1533 G_strip(answer);
1534 if (strlen(answer) == 0)
1535 return -1;
1536- G_asprintf(params, answer);
1537+ G_asprintf(params, "%s", answer);
1538 sprintf(buff,
1539 "Parameters to be used are:\n\"%s\"\nIs this correct?",
1540 *params);
1541diff --git a/lib/proj/get_proj.c b/lib/proj/get_proj.c
1542index 1a4e840..0ba19a5 100644
1543--- a/lib/proj/get_proj.c
1544+++ b/lib/proj/get_proj.c
1545@@ -234,7 +234,7 @@ int pj_get_kv(struct pj_info *info, struct Key_Value *in_proj_keys,
1546 sprintf(err, " +%s", opt_in[i]);
1547 strcat(buffa, err);
d62d471a 1548 }
705853b0
TP
1549- G_warning(buffa);
1550+ G_warning("%s", buffa);
1551 G_warning(_("The error message: %s"), pj_strerrno(pj_errno));
1552 return -1;
d62d471a 1553 }
705853b0
TP
1554diff --git a/lib/raster/io_sock.c b/lib/raster/io_sock.c
1555index 0a43f6d..fa90045 100644
1556--- a/lib/raster/io_sock.c
1557+++ b/lib/raster/io_sock.c
1558@@ -60,8 +60,8 @@ int REM_open_driver(void)
d62d471a 1559
705853b0
TP
1560 if (!name) {
1561 if (verbose) {
1562- G_warning(_("No graphics monitor has been selected for output."));
1563- G_warning(_("Please run \"d.mon\" to select a graphics monitor."));
1564+ G_warning("%s", _("No graphics monitor has been selected for output."));
1565+ G_warning("%s", _("Please run \"d.mon\" to select a graphics monitor."));
1566 }
1567 return (NO_MON);
d62d471a 1568 }
705853b0
TP
1569@@ -69,7 +69,7 @@ int REM_open_driver(void)
1570 /* Get the full path to the unix socket */
1571 if ((sockpath = G_sock_get_fname(name)) == NULL) {
1572 if (verbose)
1573- G_warning(_("Failed to get socket name for monitor <%s>."), name);
1574+ G_warning("%s", _("Failed to get socket name for monitor <%s>."), name);
1575 return (NO_MON);
d62d471a
JB
1576 }
1577
705853b0
TP
1578@@ -78,7 +78,7 @@ int REM_open_driver(void)
1579 */
1580 if (!G_sock_exists(sockpath)) {
1581 if (verbose)
1582- G_warning(_("No socket to connect to for monitor <%s>."), name);
1583+ G_warning("%s", _("No socket to connect to for monitor <%s>."), name);
1584 return (NO_MON);
d62d471a
JB
1585 }
1586
705853b0
TP
1587@@ -95,21 +95,21 @@ int REM_open_driver(void)
1588 case ECONNREFUSED:
1589 case EADDRINUSE:
1590 if (verbose) {
1591- G_warning(_("Socket is already in use or not accepting connections."));
1592- G_warning(_("Use d.mon to select a monitor"));
1593+ G_warning("%s", _("Socket is already in use or not accepting connections."));
1594+ G_warning("%s", _("Use d.mon to select a monitor"));
d62d471a 1595 }
705853b0
TP
1596 return (NO_RUN);
1597 case EBADF:
1598 case ENOTSOCK:
1599 if (verbose) {
1600- G_warning(_("Trying to connect to something not a socket."));
1601- G_warning(_("Probably program error."));
1602+ G_warning("%s", _("Trying to connect to something not a socket."));
1603+ G_warning("%s", _("Probably program error."));
1604 }
1605 return (NO_RUN);
1606 case ETIMEDOUT:
1607 if (verbose) {
1608- G_warning(_("Connect attempt timed out."));
1609- G_warning(_("Probably an error with the server."));
1610+ G_warning("%s", _("Connect attempt timed out."));
1611+ G_warning("%s", _("Probably an error with the server."));
1612 }
1613 return (NO_RUN);
1614 default:
1615@@ -117,7 +117,7 @@ int REM_open_driver(void)
d62d471a 1616 }
d62d471a 1617
705853b0
TP
1618 if (verbose)
1619- G_warning(_("Connection failed."));
1620+ G_warning("%s", _("Connection failed."));
d62d471a 1621
705853b0
TP
1622 /* We couldn't connect... */
1623 return (NO_RUN);
1624diff --git a/lib/sites/sites.c b/lib/sites/sites.c
1625index d4fef09..0a10ea1 100644
1626--- a/lib/sites/sites.c
1627+++ b/lib/sites/sites.c
1628@@ -240,7 +240,7 @@ int G_site_get_head(struct Map_info *Map, Site_head * head)
1629 (struct TimeStamp *)G_malloc(sizeof(struct TimeStamp))) == NULL)
1630 G_fatal_error(_("Memory error in allocating timestamp"));
1631 if (G_scan_timestamp(head->time, head->stime) < 0) {
1632- G_warning(datetime_error_msg());
1633+ G_warning("%s", datetime_error_msg());
d62d471a 1634
705853b0
TP
1635 head->time = NULL;
1636 head->stime = NULL;
1637diff --git a/lib/symbol/read.c b/lib/symbol/read.c
1638index c0b0c46..037c827 100644
1639--- a/lib/symbol/read.c
1640+++ b/lib/symbol/read.c
1641@@ -221,7 +221,7 @@ SYMBOL *err(FILE * fp, SYMBOL * s, char *msg)
1642 {
1643 fclose(fp);
1644 G_free(s); /* TODO: free all */
1645- G_warning(msg);
1646+ G_warning("%s", msg);
1647 return NULL;
1648 }
d62d471a 1649
705853b0
TP
1650diff --git a/lib/vector/Vlib/open.c b/lib/vector/Vlib/open.c
1651index bfb2953..aa05ab7 100644
1652--- a/lib/vector/Vlib/open.c
1653+++ b/lib/vector/Vlib/open.c
1654@@ -60,10 +60,10 @@ static void fatal_error(int ferror, char *errmsg)
1655 {
1656 switch (ferror) {
1657 case GV_FATAL_EXIT:
1658- G_fatal_error(errmsg);
1659+ G_fatal_error("%s", errmsg);
1660 break;
1661 case GV_FATAL_PRINT:
1662- G_warning(errmsg);
1663+ G_warning("%s", errmsg);
1664 break;
1665 case GV_FATAL_RETURN:
1666 break;
1667diff --git a/raster/r.describe/describe.c b/raster/r.describe/describe.c
1668index 719de3e..da6fdb3 100644
1669--- a/raster/r.describe/describe.c
1670+++ b/raster/r.describe/describe.c
1671@@ -46,7 +46,7 @@ int describe(char *name, char *mapset, int compact, char *no_data_str,
1672 if (G_get_cellhd(name, mapset, &window) < 0) {
1673 sprintf(msg, "can't get cell header for [%s] in [%s]", name,
1674 mapset);
1675- G_fatal_error(msg);
1676+ G_fatal_error("%s", msg);
d62d471a 1677 }
705853b0
TP
1678 G_set_window(&window);
1679 get_row = G_get_c_raster_row_nomask;
1680diff --git a/raster/r.external/main.c b/raster/r.external/main.c
1681index ab72f0f..09c2eca 100644
1682--- a/raster/r.external/main.c
1683+++ b/raster/r.external/main.c
1684@@ -174,7 +174,7 @@ static void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, int ove
1685 strcat(error_msg,
1686 _("Consider generating a new location from the input dataset using "
1687 "the 'location' parameter.\n"));
1688- G_fatal_error(error_msg);
1689+ G_fatal_error("%s", error_msg);
d62d471a
JB
1690 }
1691 else {
705853b0
TP
1692 G_message(_("Projection of input dataset and current location "
1693diff --git a/raster/r.flow/mem.h b/raster/r.flow/mem.h
1694index 169e487..6e44f29 100644
1695--- a/raster/r.flow/mem.h
1696+++ b/raster/r.flow/mem.h
1697@@ -37,7 +37,7 @@ void put_row_seg( /* l, row */ );
1698 segment_get_row(l.seg, l.buf[row] - l.col_offset, \
1699 row + l.row_offset) < 1)) ? \
1700 (sprintf(string, "r.flow: cannot write segment file for %s", l.name),\
1701- G_fatal_error(string), (DCELL *) NULL) : \
1702+ G_fatal_error("%s", string), (DCELL *) NULL) : \
1703 l.buf[row])
d62d471a 1704
705853b0
TP
1705 /* This was is Astley's version 12...
1706@@ -56,7 +56,7 @@ void put_row_seg( /* l, row */ );
1707 (segment_get(as.seg, &v, \
1708 row + as.row_offset, col + as.col_offset) < 1 ? \
1709 (sprintf(string,"r.flow: cannot read segment file for %s",as.name), \
1710- G_fatal_error(string)) : \
1711+ G_fatal_error("%s", string)) : \
1712 v) : \
1713 (parm.mem ? \
1714 aspect_fly(el.buf[row - 1] + col, \
1715@@ -68,7 +68,7 @@ void put_row_seg( /* l, row */ );
1716 (parm.seg ? \
1717 (segment_get(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
1718 (sprintf(string,"r.flow: cannot read segment file for %s",l.name),\
1719- G_fatal_error(string)) : \
1720+ G_fatal_error("%s", string)) : \
1721 v) : \
1722 l.buf[row][col])
d62d471a 1723
705853b0
TP
1724@@ -77,6 +77,6 @@ void put_row_seg( /* l, row */ );
1725 (v = w, \
1726 segment_put(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
1727 (sprintf(string,"r.flow: cannot write segment file for %s",l.name), \
1728- G_fatal_error(string)) : \
1729+ G_fatal_error("%s", string)) : \
1730 0) : \
1731 (l.buf[row][col] = w))
1732diff --git a/raster/r.in.arc/gethead.c b/raster/r.in.arc/gethead.c
1733index 10105ee..3a25d96 100644
1734--- a/raster/r.in.arc/gethead.c
1735+++ b/raster/r.in.arc/gethead.c
1736@@ -86,7 +86,7 @@ int gethead(FILE * fd, struct Cell_head *cellhd, int *missingval)
1737 }
d62d471a 1738
705853b0
TP
1739 G_warning(_("Illegal line in header"));
1740- G_warning(buf);
1741+ G_warning("%s", buf);
d62d471a 1742
705853b0
TP
1743 missing(s, "yllcorner");
1744 missing(w, "xllcorner");
1745@@ -98,7 +98,7 @@ int gethead(FILE * fd, struct Cell_head *cellhd, int *missingval)
d62d471a
JB
1746 }
1747
705853b0
TP
1748 if (err = G_adjust_Cell_head(cellhd, 1, 1)) {
1749- G_warning(err);
1750+ G_warning("%s", err);
1751 return 0;
1752 }
d62d471a 1753
705853b0
TP
1754diff --git a/raster/r.in.ascii/gethead.c b/raster/r.in.ascii/gethead.c
1755index 086670d..ea8e610 100644
1756--- a/raster/r.in.ascii/gethead.c
1757+++ b/raster/r.in.ascii/gethead.c
1758@@ -221,7 +221,7 @@ int gethead(FILE * fd,
1759 }
d62d471a 1760
705853b0
TP
1761 if ((err = G_adjust_Cell_head(cellhd, 1, 1))) {
1762- G_warning(err);
1763+ G_warning("%s", err);
1764 return 0;
1765 }
d62d471a 1766
705853b0
TP
1767diff --git a/raster/r.in.gdal/main.c b/raster/r.in.gdal/main.c
1768index 81ba40c..62fedb7 100644
1769--- a/raster/r.in.gdal/main.c
1770+++ b/raster/r.in.gdal/main.c
1771@@ -443,7 +443,7 @@ int main(int argc, char *argv[])
1772 strcat(error_msg,
1773 _("Consider generating a new location from the input dataset using "
1774 "the 'location' parameter.\n"));
1775- G_fatal_error(error_msg);
1776+ G_fatal_error("%s", error_msg);
1777 }
1778 else {
1779 G_message(_("Projection of input dataset and current location "
1780@@ -688,7 +688,7 @@ static void SetupReprojector(const char *pszSrcWKT, const char *pszDstLoc,
1781 target_mapset, pszDstLoc);
1782 strcat(errbuf, permissions == 0 ? _("permission denied")
1783 : _("not found"));
1784- G_fatal_error(errbuf);
1785+ G_fatal_error("%s", errbuf);
1786 } /* permission check */
d62d471a 1787
705853b0
TP
1788 /* And switch back to original location */
1789diff --git a/raster/r.in.mat/main.c b/raster/r.in.mat/main.c
1790index 4b7da0f..1927924 100644
1791--- a/raster/r.in.mat/main.c
1792+++ b/raster/r.in.mat/main.c
1793@@ -407,10 +407,10 @@ int main(int argc, char *argv[])
1794 region.zone = G_zone();
1795 buff = G_adjust_Cell_head(&region, 1, 1);
1796 if (buff)
1797- G_fatal_error(buff);
1798+ G_fatal_error("%s", buff);
1799 G_set_window(&region);
d62d471a 1800
705853b0
TP
1801- G_verbose_message("");
1802+ G_verbose_message("%s", "");
1803 G_verbose_message(_("Map <%s> bounds set to:"), map_name);
1804 G_verbose_message(_("northern edge=%f"), region.north);
1805 G_verbose_message(_("southern edge=%f"), region.south);
1806@@ -420,7 +420,7 @@ int main(int argc, char *argv[])
1807 G_verbose_message(_("ewres=%f"), region.ew_res);
1808 G_verbose_message(_("rows=%d"), region.rows);
1809 G_verbose_message(_("cols=%d"), region.cols);
1810- G_verbose_message("");
1811+ G_verbose_message("%s", "");
1812
1813 /* prep memory */
1814 raster = G_allocate_raster_buf(map_type);
1815diff --git a/raster/r.in.xyz/main.c b/raster/r.in.xyz/main.c
1816index 527ea3b..a2fc1f0 100644
1817--- a/raster/r.in.xyz/main.c
1818+++ b/raster/r.in.xyz/main.c
1819@@ -1059,7 +1059,7 @@ int main(int argc, char *argv[])
1820
1821
1822 sprintf(buff, _("%lu points found in region."), count_total);
1823- G_done_msg(buff);
1824+ G_done_msg("%s", buff);
1825 G_debug(1, "Processed %lu lines.", line);
d62d471a 1826
705853b0
TP
1827 exit(EXIT_SUCCESS);
1828diff --git a/raster/r.le/r.le.patch/driver.c b/raster/r.le/r.le.patch/driver.c
1829index 32d26ae..db368bd 100644
1830--- a/raster/r.le/r.le.patch/driver.c
1831+++ b/raster/r.le/r.le.patch/driver.c
1832@@ -2565,12 +2565,9 @@ void read_line(char *name, int line, int n, int *value, int *fvalue,
1833 }
d62d471a 1834 }
705853b0
TP
1835 if (3 > (fvalue[0] = (float)i)) {
1836- buf = G_malloc(40);
1837- sprintf(buf,
1838+ G_fatal_error(
1839 "\n No data in file\"%s\"; use r.le.setup to make file\n",
1840 path);
1841- G_fatal_error(buf);
1842- G_free(buf);
d62d471a
JB
1843 }
1844 }
705853b0
TP
1845 fclose(fp);
1846diff --git a/raster/r.out.vrml/main.c b/raster/r.out.vrml/main.c
1847index 8bb9470..5d60635 100644
1848--- a/raster/r.out.vrml/main.c
1849+++ b/raster/r.out.vrml/main.c
1850@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
1851 int elevfd = 0, colorfd = 0;
1852 FILE *vout = NULL;
1853 struct Colors colr;
1854- char errbuf[100], outfile[256];
1855+ char outfile[256];
1856 int shh, color_ok;
1857 double exag, min, max;
1858 struct GModule *module;
1859@@ -84,13 +84,11 @@ int main(int argc, char *argv[])
1860 t_mapset = NULL;
1861 t_mapset = G_find_file2("cell", rast_el->answer, "");
1862 if (!t_mapset) {
1863- sprintf(errbuf, "Couldn't find raster map %s", rast_el->answer);
1864- G_fatal_error(errbuf);
1865+ G_fatal_error("Couldn't find raster map %s", rast_el->answer);
d62d471a 1866 }
705853b0
TP
1867 if ((elevfd = G_open_cell_old(rast_el->answer, t_mapset)) == -1) {
1868- sprintf(errbuf, "Not able to open cellfile for [%s]",
1869+ G_fatal_error("Not able to open cellfile for [%s]",
1870 rast_el->answer);
1871- G_fatal_error(errbuf);
d62d471a
JB
1872 }
1873
705853b0
TP
1874 {
1875@@ -103,10 +101,9 @@ int main(int argc, char *argv[])
1876 is_fp = G_raster_map_is_fp(rast_el->answer, t_mapset);
1877 if (is_fp) {
1878 if (G_read_fp_range(rast_el->answer, t_mapset, &fp_range) != 1) {
1879- sprintf(errbuf,
1880+ G_fatal_error(
1881 "Range info for [%s] not available (run r.support)\n",
1882 rast_el->answer);
1883- G_fatal_error(errbuf);
1884 }
1885 G_get_fp_range_min_max(&fp_range, &dmin, &dmax);
1886 min = dmin;
1887@@ -114,10 +111,9 @@ int main(int argc, char *argv[])
d62d471a 1888 }
705853b0
TP
1889 else {
1890 if (G_read_range(rast_el->answer, t_mapset, &range) == -1) {
1891- sprintf(errbuf,
1892+ G_fatal_error(
1893 "Range info for [%s] not available (run r.support)\n",
1894 rast_el->answer);
1895- G_fatal_error(errbuf);
d62d471a 1896 }
705853b0
TP
1897 G_get_range_min_max(&range, &cmin, &cmax);
1898 min = cmin;
1899@@ -129,13 +125,11 @@ int main(int argc, char *argv[])
1900 t_mapset = NULL;
1901 t_mapset = G_find_file2("cell", rast_co->answer, "");
1902 if (!t_mapset) {
1903- sprintf(errbuf, "Couldn't find raster map %s", rast_co->answer);
1904- G_warning(errbuf);
1905+ G_warning("Couldn't find raster map %s", rast_co->answer);
d62d471a 1906 }
705853b0
TP
1907 else if ((colorfd = G_open_cell_old(rast_co->answer, t_mapset)) == -1) {
1908- sprintf(errbuf, "Not able to open cellfile for [%s]",
1909+ G_warning("Not able to open cellfile for [%s]",
1910 rast_co->answer);
1911- G_warning(errbuf);
d62d471a 1912 }
705853b0
TP
1913 else {
1914 G_read_colors(rast_co->answer, t_mapset, &colr);
1915@@ -162,8 +156,7 @@ int main(int argc, char *argv[])
1916 /* open file for writing VRML */
1917 G_message(_("Opening %s for writing... "), outfile);
1918 if (NULL == (vout = fopen(outfile, "w"))) {
1919- sprintf(errbuf, "Couldn't open output file %s", outfile);
1920- G_fatal_error(errbuf);
1921+ G_fatal_error("Couldn't open output file %s", outfile);
d62d471a 1922 }
d62d471a
JB
1923 }
1924
705853b0
TP
1925diff --git a/raster/r.profile/main.c b/raster/r.profile/main.c
1926index 167c1cd..e107279 100644
1927--- a/raster/r.profile/main.c
1928+++ b/raster/r.profile/main.c
1929@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
1930 sprintf(formatbuff, _("[Along Track Dist.(m)] [Elevation]"));
1931 if (clr)
1932 strcat(formatbuff, _(" [RGB Color]"));
1933- G_message(formatbuff);
1934+ G_message("%s", formatbuff);
d62d471a 1935
705853b0
TP
1936 /* Get Profile Start Coords */
1937 if (!parm.profile->answer && !parm.i->answer) {
1938diff --git a/raster/r.profile/read_rast.c b/raster/r.profile/read_rast.c
1939index 0892002..5b77f6a 100644
1940--- a/raster/r.profile/read_rast.c
1941+++ b/raster/r.profile/read_rast.c
1942@@ -46,7 +46,7 @@ int read_rast(double east, double north, double dist, int fd, int coords,
1943 row);
d62d471a 1944
705853b0
TP
1945 if (outofbounds || G_is_c_null_value(&cell[col]))
1946- sprintf(buf, null_string);
1947+ sprintf(buf, "%s", null_string);
1948 else
1949 sprintf(buf, "%d", cell[col]);
d62d471a 1950
705853b0
TP
1951@@ -74,7 +74,7 @@ int read_rast(double east, double north, double dist, int fd, int coords,
1952 row);
d62d471a 1953
705853b0
TP
1954 if (outofbounds || G_is_f_null_value(&fcell[col]))
1955- sprintf(buf, null_string);
1956+ sprintf(buf, "%s", null_string);
1957 else
1958 sprintf(buf, "%f", fcell[col]);
d62d471a 1959
705853b0
TP
1960@@ -102,7 +102,7 @@ int read_rast(double east, double north, double dist, int fd, int coords,
1961 row);
d62d471a 1962
705853b0
TP
1963 if (outofbounds || G_is_d_null_value(&dcell[col]))
1964- sprintf(buf, null_string);
1965+ sprintf(buf, "%s", null_string);
1966 else
1967 sprintf(buf, "%f", dcell[col]);
d62d471a 1968
705853b0
TP
1969diff --git a/raster/r.quant/main.c b/raster/r.quant/main.c
1970index f648d6f..80d6038 100644
1971--- a/raster/r.quant/main.c
1972+++ b/raster/r.quant/main.c
1973@@ -24,7 +24,6 @@
d62d471a 1974
705853b0
TP
1975 int main(int argc, char *argv[])
1976 {
1977- char buf[1024];
1978 struct GModule *module;
1979 struct Option *input, *basemap, *fprange, *range;
1980 struct Flag *trunc, *rnd;
1981@@ -93,14 +92,12 @@ int main(int argc, char *argv[])
1982 name[noi] = G_store(input->answers[noi]);
1983 mapset[noi] = G_find_cell2(name[noi], "");
1984 if (mapset[noi] == NULL) {
1985- sprintf(buf, "%s - not found", name[noi]);
1986- G_fatal_error(buf);
1987+ G_fatal_error("%s - not found", name[noi]);
d62d471a
JB
1988 }
1989
705853b0
TP
1990 if (G_raster_map_type(name[noi], mapset[noi]) == CELL_TYPE) {
1991- sprintf(buf, "%s is integer map, it can't be quantized",
1992+ G_fatal_error("%s is integer map, it can't be quantized",
1993 name[noi]);
1994- G_fatal_error(buf);
d62d471a 1995 }
d62d471a
JB
1996 }
1997
705853b0
TP
1998@@ -122,20 +119,17 @@ int main(int argc, char *argv[])
1999 {
2000 basemapset = G_find_cell2(basename, "");
2001 if (basemapset == NULL) {
2002- sprintf(buf, "%s - not found", basename);
2003- G_fatal_error(buf);
2004+ G_fatal_error("%s - not found", basename);
d62d471a
JB
2005 }
2006
705853b0
TP
2007 if (G_raster_map_type(basename, basemapset) == CELL_TYPE) {
2008- sprintf(buf, "%s is integer map, it can't be used as basemap",
2009+ G_fatal_error("%s is integer map, it can't be used as basemap",
2010 basename);
2011- G_fatal_error(buf);
d62d471a
JB
2012 }
2013
705853b0
TP
2014 if (G_read_quant(basename, basemapset, &quant_struct) <= 0) {
2015- sprintf(buf, "Can't read quant rules for basemap %s! Exiting.",
2016+ G_fatal_error("Can't read quant rules for basemap %s! Exiting.",
2017 basename);
2018- G_fatal_error(buf);
d62d471a 2019 }
d62d471a 2020 }
d62d471a 2021
705853b0
TP
2022diff --git a/raster/r.quant/read_rules.c b/raster/r.quant/read_rules.c
2023index 82a6779..0c38c0a 100644
2024--- a/raster/r.quant/read_rules.c
2025+++ b/raster/r.quant/read_rules.c
2026@@ -12,20 +12,17 @@ int read_range(void)
2027 struct Range range;
2028 CELL tmp_min, tmp_max;
2029 DCELL tmp_dmin, tmp_dmax;
2030- char buff[1024];
2031 int i;
d62d471a 2032
705853b0
TP
2033 /* read the fpranges and ranges of all input maps */
2034 for (i = 0; i < noi; i++) {
2035 if (G_read_fp_range(name[i], mapset[i], &drange) <= 0) {
2036- sprintf(buff, "Can't read f_range for map %s", name[i]);
2037- G_fatal_error(buff);
2038+ G_fatal_error("Can't read f_range for map %s", name[i]);
d62d471a 2039 }
705853b0
TP
2040 G_get_fp_range_min_max(&drange, &tmp_dmin, &tmp_dmax);
2041
2042 if (G_read_range(name[i], mapset[i], &range) <= 0) {
2043- sprintf(buff, "Can't read range for map %s", name[i]);
2044- G_fatal_error(buff);
2045+ G_fatal_error("Can't read range for map %s", name[i]);
d62d471a 2046 }
705853b0
TP
2047 G_get_range_min_max(&range, &tmp_min, &tmp_max);
2048 if (!i || tmp_max > old_max || G_is_c_null_value(&old_max))
2049diff --git a/raster/r.random.surface/init.c b/raster/r.random.surface/init.c
2050index b4fdbae..955ac11 100644
2051--- a/raster/r.random.surface/init.c
2052+++ b/raster/r.random.surface/init.c
2053@@ -207,7 +207,7 @@ void Init(int argc, char **argv)
2054 Seeds[i] = Seeds[i] % SEED_MAX;
2055 sprintf(msg2, _(" seed is set to %d"), Seeds[i]);
2056 strcat(msg, msg2);
2057- G_warning(msg);
2058+ G_warning("%s", msg);
d62d471a 2059 }
705853b0
TP
2060 else if (Seeds[i] < SEED_MIN) {
2061 sprintf(msg, _("Seed (%d) smaller than minimum (%d)"),
2062@@ -216,7 +216,7 @@ void Init(int argc, char **argv)
2063 Seeds[i] += SEED_MAX - SEED_MIN;
2064 sprintf(msg2, _(" seed is set to %d"), Seeds[i]);
2065 strcat(msg, msg2);
2066- G_warning(msg);
2067+ G_warning("%s", msg);
d62d471a 2068 }
705853b0
TP
2069 } /* /for */
2070 } /* /else */
2071diff --git a/raster/r.reclass/main.c b/raster/r.reclass/main.c
2072index dcbcd0c..362b937 100644
2073--- a/raster/r.reclass/main.c
2074+++ b/raster/r.reclass/main.c
2075@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
d62d471a 2076 }
705853b0
TP
2077 else {
2078 strcat(buf, _(" - invalid reclass rule"));
2079- G_fatal_error(buf);
2080+ G_fatal_error("%s", buf);
2081 }
2082 break;
d62d471a 2083
705853b0
TP
2084diff --git a/raster/r.resamp.rst/main.c b/raster/r.resamp.rst/main.c
2085index e84965b..5032d38 100644
2086--- a/raster/r.resamp.rst/main.c
2087+++ b/raster/r.resamp.rst/main.c
2088@@ -718,5 +718,5 @@ void clean_fatal_error(char *str)
d62d471a
JB
2089 fclose(Tmp_fd_xy);
2090 unlink(Tmp_file_xy);
2091 }
2092- G_fatal_error(str);
2093+ G_fatal_error("%s", str);
2094 }
705853b0
TP
2095diff --git a/raster/r.rescale.eq/main.c b/raster/r.rescale.eq/main.c
2096index 2b0ebd2..52998fa 100644
2097--- a/raster/r.rescale.eq/main.c
2098+++ b/raster/r.rescale.eq/main.c
2099@@ -115,11 +115,11 @@ int main(int argc, char *argv[])
2100 mapset = G_find_cell(old_name, "");
2101 if (mapset == NULL) {
2102 sprintf(buf, "%s - not found\n", old_name);
2103- G_fatal_error(buf);
2104+ G_fatal_error("%s", buf);
d62d471a 2105 }
705853b0
TP
2106 if (G_legal_filename(new_name) < 0) {
2107 sprintf(buf, "%s - illegal map name\n", new_name);
2108- G_fatal_error(buf);
2109+ G_fatal_error("%s", buf);
d62d471a
JB
2110 }
2111
705853b0
TP
2112 get_stats(old_name, mapset, &statf);
2113diff --git a/raster/r.rescale/main.c b/raster/r.rescale/main.c
2114index ef1113f..1e9469f 100644
2115--- a/raster/r.rescale/main.c
2116+++ b/raster/r.rescale/main.c
2117@@ -110,11 +110,11 @@ int main(int argc, char *argv[])
2118 mapset = G_find_cell(old_name, "");
2119 if (mapset == NULL) {
2120 sprintf(buf, "%s - not found\n", old_name);
2121- G_fatal_error(buf);
2122+ G_fatal_error("%s", buf);
d62d471a 2123 }
705853b0
TP
2124 if (G_legal_filename(new_name) < 0) {
2125 sprintf(buf, "%s - illegal map name\n", new_name);
2126- G_fatal_error(buf);
2127+ G_fatal_error("%s", buf);
d62d471a
JB
2128 }
2129
705853b0
TP
2130 if (parm.from->answer) {
2131diff --git a/raster/r.surf.contour/bseg_get.c b/raster/r.surf.contour/bseg_get.c
2132index c70902a..0bb4b6f 100644
2133--- a/raster/r.surf.contour/bseg_get.c
2134+++ b/raster/r.surf.contour/bseg_get.c
2135@@ -4,13 +4,11 @@
2136 int bseg_get(BSEG * bseg, char * value, int row, int col)
2137 {
2138 unsigned char x;
2139- char errmsg[200];
d62d471a 2140
705853b0
TP
2141 if (segment_get(&(bseg->seg), &x, row, col >> 3) < 0) {
2142- sprintf(errmsg,
2143+ G_warning(
2144 "bseg_get(): could not read segment file at r:%d c:%d",
2145 (int)row, (int)col);
2146- G_warning(errmsg);
2147 return -1;
d62d471a 2148 }
705853b0
TP
2149 *value = (char) ((x & (1 << (col & 7))) ? 1 : 0);
2150diff --git a/raster/r.surf.contour/bseg_put.c b/raster/r.surf.contour/bseg_put.c
2151index 31010d8..036363f 100644
2152--- a/raster/r.surf.contour/bseg_put.c
2153+++ b/raster/r.surf.contour/bseg_put.c
2154@@ -4,13 +4,11 @@
2155 int bseg_put(BSEG * bseg, char * value, int row, int col)
2156 {
2157 unsigned char old_value;
2158- char errmsg[200];
d62d471a 2159
705853b0
TP
2160 if (segment_get(&(bseg->seg), &old_value, row, col >> 3) < 0) {
2161- sprintf(errmsg,
2162+ G_warning(
2163 "bseg_put(): could not read segment file at r:%d c:%d",
2164 (int)row, (int)col);
2165- G_warning(errmsg);
2166 return -1;
2167 }
2168 if (*value)
2169@@ -18,10 +16,9 @@ int bseg_put(BSEG * bseg, char * value, int row, int col)
2170 else
2171 old_value &= ~(1 << (col & 7));
2172 if (segment_put(&(bseg->seg), &old_value, row, col >> 3) < 0) {
2173- sprintf(errmsg,
2174+ G_warning(
2175 "bseg_put(): could not write segment file at r:%d c:%d",
2176 (int)row, (int)col);
2177- G_warning(errmsg);
2178 return -2;
d62d471a 2179 }
705853b0
TP
2180 return 0;
2181diff --git a/raster/r.surf.contour/bseg_read.c b/raster/r.surf.contour/bseg_read.c
2182index 8fbf4c2..a2df0ef 100644
2183--- a/raster/r.surf.contour/bseg_read.c
2184+++ b/raster/r.surf.contour/bseg_read.c
2185@@ -9,7 +9,6 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
2186 int row, nrows;
2187 int col, ncols;
2188 int map_fd;
2189- char msg[100];
2190 CELL *buffer;
2191 char value;
d62d471a 2192
705853b0 2193@@ -18,9 +17,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
d62d471a 2194
705853b0
TP
2195 map_fd = G_open_cell_old(map_name, mapset);
2196 if (map_fd < 0) {
2197- sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
2198+ G_warning("%s(): unable to open file [%s] in [%s], %d",
2199 me, map_name, mapset, map_fd);
2200- G_warning(msg);
2201 return -3;
d62d471a 2202 }
705853b0
TP
2203 nrows = G_window_rows();
2204@@ -30,9 +28,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
2205 if (G_get_map_row(map_fd, buffer, row) < 0) {
2206 G_free(buffer);
2207 G_close_cell(map_fd);
2208- sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
2209+ G_warning("%s(): unable to read file [%s] in [%s], %d %d",
2210 me, map_name, mapset, row, nrows);
2211- G_warning(msg);
2212 return -2;
d62d471a 2213 }
705853b0
TP
2214 for (col = ncols; col >= 0; col--) {
2215diff --git a/raster/r.surf.contour/dseg_read.c b/raster/r.surf.contour/dseg_read.c
2216index af5362d..83ccaa1 100644
2217--- a/raster/r.surf.contour/dseg_read.c
2218+++ b/raster/r.surf.contour/dseg_read.c
2219@@ -8,16 +8,14 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
2220 {
2221 int row, nrows;
2222 int map_fd;
2223- char msg[100];
2224 DCELL *buffer;
d62d471a 2225
705853b0
TP
2226 dseg->name = NULL;
2227 dseg->mapset = NULL;
d62d471a 2228
705853b0
TP
2229 if ((map_fd = G_open_cell_old(map_name, mapset)) < 0) {
2230- sprintf(msg, "%s(): unable to open file [%s] in [%s]",
2231+ G_warning("%s(): unable to open file [%s] in [%s]",
2232 me, map_name, mapset);
2233- G_warning(msg);
2234 return -3;
2235 }
2236 nrows = G_window_rows();
2237@@ -26,17 +24,15 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
2238 if (G_get_d_raster_row(map_fd, buffer, row) < 0) {
2239 G_free(buffer);
2240 G_close_cell(map_fd);
2241- sprintf(msg, "%s(): unable to read file [%s] in [%s]",
2242+ G_warning("%s(): unable to read file [%s] in [%s]",
2243 me, map_name, mapset);
2244- G_warning(msg);
2245 return -2;
d62d471a 2246 }
705853b0
TP
2247 if (segment_put_row(&(dseg->seg), buffer, row) < 0) {
2248 G_free(buffer);
2249 G_close_cell(map_fd);
2250- sprintf(msg, "%s(): unable to segment put row for [%s] in [%s]",
2251+ G_warning("%s(): unable to segment put row for [%s] in [%s]",
2252 me, map_name, mapset);
2253- G_warning(msg);
2254 return (-1);
d62d471a
JB
2255 }
2256 }
705853b0
TP
2257diff --git a/raster/r.surf.contour/dseg_write.c b/raster/r.surf.contour/dseg_write.c
2258index 126e65e..0a369dd 100644
2259--- a/raster/r.surf.contour/dseg_write.c
2260+++ b/raster/r.surf.contour/dseg_write.c
2261@@ -7,13 +7,11 @@ int dseg_write_cellfile(DSEG * dseg, char *map_name)
2262 {
2263 int map_fd;
2264 int row, nrows;
2265- char msg[100];
2266 DCELL *buffer;
d62d471a 2267
705853b0
TP
2268 map_fd = G_open_raster_new(map_name, DCELL_TYPE);
2269 if (map_fd < 0) {
2270- sprintf(msg, "%s(): unable to open new map layer [%s]", me, map_name);
2271- G_warning(msg);
2272+ G_warning("%s(): unable to open new map layer [%s]", me, map_name);
2273 return -1;
d62d471a 2274 }
705853b0
TP
2275 nrows = G_window_rows();
2276@@ -23,10 +21,9 @@ int dseg_write_cellfile(DSEG * dseg, char *map_name)
2277 if (G_put_raster_row(map_fd, buffer, DCELL_TYPE) < 0) {
2278 G_free(buffer);
2279 G_unopen_cell(map_fd);
2280- sprintf(msg,
2281+ G_warning(
2282 "%s(): unable to write new map layer [%s], row %d",
2283 me, map_name, row);
2284- G_warning(msg);
2285 return -2;
d62d471a 2286 }
705853b0
TP
2287 }
2288diff --git a/raster/r.to.rast3/main.c b/raster/r.to.rast3/main.c
2289index a36f086..f47835a 100644
2290--- a/raster/r.to.rast3/main.c
2291+++ b/raster/r.to.rast3/main.c
2292@@ -63,7 +63,7 @@ void fatal_error(void *map, int *fd, int depths, char *errorMsg)
2293 close_input_raster_map(fd[i]);
d62d471a
JB
2294 }
2295
705853b0
TP
2296- G3d_fatalError(errorMsg);
2297+ G3d_fatalError("%s", errorMsg);
2298 exit(EXIT_FAILURE);
d62d471a 2299
705853b0
TP
2300 }
2301@@ -205,7 +205,7 @@ int main(int argc, char *argv[])
d62d471a 2302
705853b0
TP
2303 /*Check for output */
2304 if (param.output->answer == NULL)
2305- G3d_fatalError(_("No output map"));
2306+ G3d_fatalError("%s", _("No output map"));
d62d471a 2307
705853b0
TP
2308 /* Figure out the region from the map */
2309 G3d_initDefaults();
2310@@ -338,7 +338,7 @@ int main(int argc, char *argv[])
d62d471a 2311
705853b0 2312 /* Close files and exit */
d62d471a 2313 if (!G3d_closeCell(map))
705853b0
TP
2314- G3d_fatalError(_("Error closing 3d raster map"));
2315+ G3d_fatalError("%s", _("Error closing 3d raster map"));
d62d471a 2316
705853b0 2317 map = NULL;
d62d471a 2318
705853b0
TP
2319diff --git a/raster/r.to.rast3elev/main.c b/raster/r.to.rast3elev/main.c
2320index 340460b..8b52489 100644
2321--- a/raster/r.to.rast3elev/main.c
2322+++ b/raster/r.to.rast3elev/main.c
2323@@ -189,7 +189,7 @@ void fatal_error(Database db, char *errorMsg)
2324 if (db.elev)
2325 close_input_raster_map(db.elev);
d62d471a 2326
705853b0
TP
2327- G3d_fatalError(errorMsg);
2328+ G3d_fatalError("%s", errorMsg);
2329 exit(EXIT_FAILURE);
2330 }
d62d471a 2331
705853b0
TP
2332diff --git a/raster/r.to.vect/areas_io.c b/raster/r.to.vect/areas_io.c
2333index 9677ea7..d68a5fa 100644
2334--- a/raster/r.to.vect/areas_io.c
2335+++ b/raster/r.to.vect/areas_io.c
2336@@ -365,7 +365,7 @@ int write_area(struct area_table *a_list, /* list of areas */
2337 }
d62d471a 2338
705853b0
TP
2339 db_append_string(&sql, ")");
2340- G_debug(3, db_get_string(&sql));
2341+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2342
705853b0
TP
2343 if (db_execute_immediate(driver, &sql) != DB_OK)
2344 G_fatal_error(_("Cannot insert new row: %s"),
2345diff --git a/raster/r.to.vect/main.c b/raster/r.to.vect/main.c
2346index 556d977..d849d29 100644
2347--- a/raster/r.to.vect/main.c
2348+++ b/raster/r.to.vect/main.c
2349@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
d62d471a 2350
705853b0 2351 db_append_string(&sql, ")");
d62d471a 2352
705853b0
TP
2353- G_debug(3, db_get_string(&sql));
2354+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2355
705853b0
TP
2356 if (db_execute_immediate(driver, &sql) != DB_OK)
2357 G_fatal_error(_("Unable to create table: %s"),
2358@@ -268,7 +268,7 @@ int main(int argc, char *argv[])
2359 sprintf(buf, "insert into %s values ( %d, '%s')", Fi->table,
2360 cat, db_get_string(&label));
2361 db_set_string(&sql, buf);
2362- G_debug(3, db_get_string(&sql));
2363+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2364
705853b0
TP
2365 if (db_execute_immediate(driver, &sql) != DB_OK)
2366 G_fatal_error(_("Unable to insert into table: %s"),
2367diff --git a/raster/r.to.vect/util.c b/raster/r.to.vect/util.c
2368index dfdff50..d537104 100644
2369--- a/raster/r.to.vect/util.c
2370+++ b/raster/r.to.vect/util.c
2371@@ -150,7 +150,7 @@ void insert_value(int cat, int val, double dval)
d62d471a 2372
d62d471a 2373 db_append_string(&sql, ")");
705853b0 2374
d62d471a
JB
2375- G_debug(3, db_get_string(&sql));
2376+ G_debug(3, "%s", db_get_string(&sql));
2377
705853b0
TP
2378 if (db_execute_immediate(driver, &sql) != DB_OK)
2379 G_fatal_error(_("Cannot insert new row: %s"), db_get_string(&sql));
2380diff --git a/raster/r.volume/main.c b/raster/r.volume/main.c
2381index 1d2fe73..ab739e6 100644
2382--- a/raster/r.volume/main.c
2383+++ b/raster/r.volume/main.c
2384@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
2385 "Row=%d Col=%d Cat=%d in clump map [%s]; max=%d.\n",
2386 row, col, i, clumpmap, max);
2387 strcat(buf, "Cat value > max returned by G_number_of_cats.");
2388- G_fatal_error(buf);
2389+ G_fatal_error("%s", buf);
d62d471a 2390 }
705853b0
TP
2391 if (i < 1)
2392 continue; /* ignore zeros and negs */
2393diff --git a/raster/r.water.outlet/legal.c b/raster/r.water.outlet/legal.c
2394index 3615668..0a97bd9 100644
2395--- a/raster/r.water.outlet/legal.c
2396+++ b/raster/r.water.outlet/legal.c
2397@@ -8,7 +8,7 @@ int do_legal(char *file_name)
2398
2399 if (G_legal_filename(file_name) == -1) {
2400 G_asprintf(&buf, _("<%s> is an illegal file name"), file_name);
2401- G_fatal_error(buf);
2402+ G_fatal_error("%s", buf);
d62d471a
JB
2403 }
2404
705853b0
TP
2405 return 0;
2406@@ -21,7 +21,7 @@ char *do_exist(char *file_name)
2407 file_mapset = G_find_cell2(file_name, "");
2408 if (file_mapset == NULL) {
2409 G_asprintf(&buf, _("Raster map <%s> not found"), file_name);
2410- G_fatal_error(buf);
2411+ G_fatal_error("%s", buf);
d62d471a 2412 }
705853b0
TP
2413 return (file_mapset);
2414 }
2415diff --git a/raster/r.water.outlet/main.c b/raster/r.water.outlet/main.c
2416index 5d74772..4fab739 100644
2417--- a/raster/r.water.outlet/main.c
2418+++ b/raster/r.water.outlet/main.c
2419@@ -83,7 +83,7 @@ int main(int argc, char *argv[])
d62d471a 2420
705853b0
TP
2421 if (G_get_window(&window) < 0) {
2422 G_asprintf(&buf, _("Unable to read current window parameters"));
2423- G_fatal_error(buf);
2424+ G_fatal_error("%s", buf);
d62d471a
JB
2425 }
2426
705853b0
TP
2427 strcpy(drain_name, opt1->answer);
2428diff --git a/raster/r.watershed/seg/bseg_read.c b/raster/r.watershed/seg/bseg_read.c
2429index 9c0b0f9..f507931 100644
2430--- a/raster/r.watershed/seg/bseg_read.c
2431+++ b/raster/r.watershed/seg/bseg_read.c
2432@@ -9,7 +9,6 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
2433 int row, nrows;
2434 int col, ncols;
2435 int map_fd;
2436- char msg[100];
2437 CELL *buffer;
d62d471a 2438
705853b0
TP
2439 bseg->name = NULL;
2440@@ -17,9 +16,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
d62d471a 2441
705853b0
TP
2442 map_fd = G_open_cell_old(map_name, mapset);
2443 if (map_fd < 0) {
2444- sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
2445+ G_warning("%s(): unable to open file [%s] in [%s], %d",
2446 me, map_name, mapset, map_fd);
2447- G_warning(msg);
2448 return -3;
d62d471a 2449 }
705853b0
TP
2450 nrows = G_window_rows();
2451@@ -29,9 +27,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
2452 if (G_get_c_raster_row(map_fd, buffer, row) < 0) {
2453 G_free(buffer);
2454 G_close_cell(map_fd);
2455- sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
2456+ G_warning("%s(): unable to read file [%s] in [%s], %d %d",
2457 me, map_name, mapset, row, nrows);
2458- G_warning(msg);
2459 return -2;
2460 }
2461 for (col = ncols; col >= 0; col--) {
2462diff --git a/raster/r.watershed/seg/cseg_read.c b/raster/r.watershed/seg/cseg_read.c
2463index 14e5f27..3f25a95 100644
2464--- a/raster/r.watershed/seg/cseg_read.c
2465+++ b/raster/r.watershed/seg/cseg_read.c
2466@@ -8,7 +8,6 @@ int cseg_read_cell(CSEG * cseg, char *map_name, char *mapset)
2467 {
2468 int row, nrows;
2469 int map_fd;
2470- char msg[100];
2471 CELL *buffer;
d62d471a 2472
705853b0
TP
2473 cseg->name = NULL;
2474@@ -16,9 +15,8 @@ int cseg_read_cell(CSEG * cseg, char *map_name, char *mapset)
d62d471a 2475
705853b0
TP
2476 map_fd = G_open_cell_old(map_name, mapset);
2477 if (map_fd < 0) {
2478- sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
2479+ G_warning("%s(): unable to open file [%s] in [%s], %d",
2480 me, map_name, mapset, map_fd);
2481- G_warning(msg);
2482 return -3;
2483 }
2484 nrows = G_window_rows();
2485@@ -27,17 +25,15 @@ int cseg_read_cell(CSEG * cseg, char *map_name, char *mapset)
2486 if (G_get_c_raster_row(map_fd, buffer, row) < 0) {
2487 G_free(buffer);
2488 G_close_cell(map_fd);
2489- sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
2490+ G_warning("%s(): unable to read file [%s] in [%s], %d %d",
2491 me, map_name, mapset, row, nrows);
2492- G_warning(msg);
2493 return -2;
2494 }
2495 if (segment_put_row(&(cseg->seg), buffer, row) < 0) {
2496 G_free(buffer);
2497 G_close_cell(map_fd);
2498- sprintf(msg, "%s(): unable to segment put row for [%s] in [%s]",
2499+ G_warning("%s(): unable to segment put row for [%s] in [%s]",
2500 me, map_name, mapset);
2501- G_warning(msg);
2502 return (-1);
d62d471a 2503 }
d62d471a 2504 }
705853b0
TP
2505diff --git a/raster/r.watershed/seg/dseg_read.c b/raster/r.watershed/seg/dseg_read.c
2506index 4d5cd51..f7ab151 100644
2507--- a/raster/r.watershed/seg/dseg_read.c
2508+++ b/raster/r.watershed/seg/dseg_read.c
2509@@ -8,7 +8,6 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
2510 {
2511 int row, nrows, ncols;
2512 int map_fd;
2513- char msg[100];
2514 double *dbuffer;
d62d471a 2515
705853b0
TP
2516 dseg->name = NULL;
2517@@ -16,9 +15,8 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
d62d471a 2518
705853b0
TP
2519 map_fd = G_open_cell_old(map_name, mapset);
2520 if (map_fd < 0) {
2521- sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
2522+ G_warning("%s(): unable to open file [%s] in [%s], %d",
2523 me, map_name, mapset, map_fd);
2524- G_warning(msg);
2525 return -3;
d62d471a 2526 }
705853b0
TP
2527 nrows = G_window_rows();
2528@@ -28,17 +26,15 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
2529 if (G_get_d_raster_row(map_fd, dbuffer, row) < 0) {
2530 G_free(dbuffer);
2531 G_close_cell(map_fd);
2532- sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
2533+ G_warning("%s(): unable to read file [%s] in [%s], %d %d",
2534 me, map_name, mapset, row, nrows);
2535- G_warning(msg);
2536 return -2;
2537 }
2538 if (segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) {
2539 G_free(dbuffer);
2540 G_close_cell(map_fd);
2541- sprintf(msg, "%s(): unable to segment put row for [%s] in [%s]",
2542+ G_warning("%s(): unable to segment put row for [%s] in [%s]",
2543 me, map_name, mapset);
2544- G_warning(msg);
2545 return (-1);
d62d471a 2546 }
d62d471a 2547 }
705853b0
TP
2548diff --git a/raster/r.what/die.c b/raster/r.what/die.c
2549index f22e45c..5c253de 100644
2550--- a/raster/r.what/die.c
2551+++ b/raster/r.what/die.c
2552@@ -6,7 +6,7 @@ void die(char *a, char *b)
2553 char *message;
d62d471a 2554
705853b0
TP
2555 G_asprintf(&message, "%s: %s %s", G_program_name(), a, b);
2556- G_fatal_error(message);
2557+ G_fatal_error("%s", message);
d62d471a 2558
705853b0 2559 return;
d62d471a 2560 }
705853b0
TP
2561diff --git a/raster/wildfire/r.spread/collect_ori.c b/raster/wildfire/r.spread/collect_ori.c
2562index fe2eaa3..e958410 100644
2563--- a/raster/wildfire/r.spread/collect_ori.c
2564+++ b/raster/wildfire/r.spread/collect_ori.c
2565@@ -48,7 +48,6 @@ void collect_ori(int start_fd)
2566 extern CELL *cell;
2567 extern CELL *map_base, *map_x_out, *map_y_out, *map_visit;
2568 extern float *map_out;
2569- extern char buf[];
2570 extern float neg, zero;
2571 extern int BARRIER;
2572 extern int nrows, ncols;
2573@@ -65,10 +64,9 @@ void collect_ori(int start_fd)
2574 if (*(cell + col) > 0) {
2575 /*Check if starting sources legally ? */
2576 if (DATA(map_base, row, col) <= 0) {
2577- sprintf(buf,
2578+ G_warning(
2579 "can't start from a BARRIER at cell (%d,%d), request ignored\n",
2580 col, row);
2581- G_warning(buf);
2582 continue;
2583 }
d62d471a 2584
705853b0
TP
2585diff --git a/raster3d/r3.cross.rast/main.c b/raster3d/r3.cross.rast/main.c
2586index 4fbf50c..b027c04 100644
2587--- a/raster3d/r3.cross.rast/main.c
2588+++ b/raster3d/r3.cross.rast/main.c
2589@@ -62,7 +62,7 @@ void fatal_error(void *map, int elevfd, int outfd, char *errorMsg)
2590 if (elevfd != -1)
2591 close_output_map(elevfd);
d62d471a 2592
705853b0
TP
2593- G3d_fatalError(errorMsg);
2594+ G3d_fatalError("%s", errorMsg);
2595 exit(EXIT_FAILURE);
d62d471a 2596
705853b0
TP
2597 }
2598diff --git a/raster3d/r3.in.ascii/main.c b/raster3d/r3.in.ascii/main.c
2599index 1b959e1..924c342 100644
2600--- a/raster3d/r3.in.ascii/main.c
2601+++ b/raster3d/r3.in.ascii/main.c
2602@@ -56,7 +56,7 @@ static void fatalError(char *errorMsg)
2603 G3d_closeCell(map);
d62d471a
JB
2604 }
2605
705853b0
TP
2606- G3d_fatalError(errorMsg);
2607+ G3d_fatalError("%s", errorMsg);
2608 }
d62d471a 2609
705853b0
TP
2610 /*---------------------------------------------------------------------------*/
2611diff --git a/raster3d/r3.in.v5d/main.c b/raster3d/r3.in.v5d/main.c
2612index 827c199..4867b65 100644
2613--- a/raster3d/r3.in.v5d/main.c
2614+++ b/raster3d/r3.in.v5d/main.c
2615@@ -46,7 +46,7 @@ static void fatalError(char *errorMsg)
2616 /* should unopen map here! */
d62d471a
JB
2617 }
2618
705853b0
TP
2619- G3d_fatalError(errorMsg);
2620+ G3d_fatalError("%s", errorMsg);
2621 }
d62d471a 2622
705853b0
TP
2623 /*---------------------------------------------------------------------------*/
2624diff --git a/raster3d/r3.out.ascii/main.c b/raster3d/r3.out.ascii/main.c
2625index 1059cde..8181348 100644
2626--- a/raster3d/r3.out.ascii/main.c
2627+++ b/raster3d/r3.out.ascii/main.c
2628@@ -59,7 +59,7 @@ void fatalError(char *errorMsg)
d62d471a 2629
d62d471a 2630 }
d62d471a 2631
705853b0
TP
2632- G3d_fatalError(errorMsg);
2633+ G3d_fatalError("%s", errorMsg);
2634 }
d62d471a 2635
705853b0
TP
2636 /*---------------------------------------------------------------------------*/
2637diff --git a/raster3d/r3.out.v5d/main.c b/raster3d/r3.out.v5d/main.c
2638index 96cb985..ec8b0d5 100644
2639--- a/raster3d/r3.out.v5d/main.c
2640+++ b/raster3d/r3.out.v5d/main.c
2641@@ -54,7 +54,7 @@ void fatalError(char *errorMsg)
2642 fatalError(_("Unable to close 3D raster map"));
d62d471a
JB
2643 }
2644
705853b0
TP
2645- G3d_fatalError(errorMsg);
2646+ G3d_fatalError("%s", errorMsg);
2647 }
d62d471a 2648
705853b0
TP
2649 /*---------------------------------------------------------------------------*/
2650diff --git a/raster3d/r3.to.rast/main.c b/raster3d/r3.to.rast/main.c
2651index 7f794ed..b7712df 100644
2652--- a/raster3d/r3.to.rast/main.c
2653+++ b/raster3d/r3.to.rast/main.c
2654@@ -60,7 +60,7 @@ void fatal_error(void *map, int *fd, int depths, char *errorMsg)
2655 G_unopen_cell(fd[i]);
d62d471a 2656 }
d62d471a 2657
705853b0
TP
2658- G3d_fatalError(errorMsg);
2659+ G3d_fatalError("%s", errorMsg);
2660 exit(EXIT_FAILURE);
d62d471a 2661
705853b0
TP
2662 }
2663diff --git a/vector/v.convert/att.c b/vector/v.convert/att.c
2664index 36acbd7..db442f6 100644
2665--- a/vector/v.convert/att.c
2666+++ b/vector/v.convert/att.c
2667@@ -60,7 +60,7 @@ int attributes(char *in, struct Map_info *Out)
2668 fi->table, clen);
2669 db_append_string(&sql, buf);
d62d471a 2670
705853b0
TP
2671- G_debug(1, db_get_string(&sql));
2672+ G_debug(1, "%s", db_get_string(&sql));
d62d471a 2673
705853b0
TP
2674 driver = db_start_driver(fi->driver);
2675 if (driver == NULL)
2676@@ -102,7 +102,7 @@ int attributes(char *in, struct Map_info *Out)
2677 sprintf(buf, "insert into %s values ( %d, '%s')", fi->table, cat,
2678 db_get_string(&lab));
2679 db_set_string(&sql, buf);
2680- G_debug(3, db_get_string(&sql));
2681+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2682
705853b0
TP
2683 if (db_execute_immediate(driver, &sql) != DB_OK) {
2684 db_close_database(driver);
2685diff --git a/vector/v.in.ascii/in.c b/vector/v.in.ascii/in.c
2686index d7bbe5d..21f506e 100644
2687--- a/vector/v.in.ascii/in.c
2688+++ b/vector/v.in.ascii/in.c
2689@@ -380,7 +380,7 @@ int main(int argc, char *argv[])
2690 Fi->driver);
d62d471a 2691
705853b0
TP
2692 /* Create table */
2693- G_debug(3, db_get_string(&sql));
2694+ G_debug(3, "%s", db_get_string(&sql));
2695 if (db_execute_immediate(driver, &sql) != DB_OK) {
2696 Vect_delete(new->answer);
2697 G_fatal_error(_("Unable to create table: %s"),
2698diff --git a/vector/v.in.ascii/points.c b/vector/v.in.ascii/points.c
2699index 02ee5e4..ef0e47c 100644
2700--- a/vector/v.in.ascii/points.c
2701+++ b/vector/v.in.ascii/points.c
2702@@ -399,7 +399,7 @@ int points_to_bin(FILE * ascii, int rowlen, struct Map_info *Map,
2703 db_append_string(&sql, buf2);
d62d471a 2704 }
705853b0
TP
2705 db_append_string(&sql, ")");
2706- G_debug(3, db_get_string(&sql));
2707+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2708
705853b0
TP
2709 if (db_execute_immediate(driver, &sql) != DB_OK) {
2710 G_fatal_error(_("Unable to insert new record: %s"),
2711diff --git a/vector/v.in.dwg/entity.c b/vector/v.in.dwg/entity.c
2712index 0311113..203d6d6 100644
2713--- a/vector/v.in.dwg/entity.c
2714+++ b/vector/v.in.dwg/entity.c
2715@@ -262,7 +262,7 @@ int write_line(PAD_ENT_HDR adenhd, int type, int level)
2716 db_append_string(&sql, buf);
d62d471a 2717
705853b0
TP
2718 db_append_string(&sql, ")");
2719- G_debug(3, db_get_string(&sql));
2720+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2721
705853b0
TP
2722 if (db_execute_immediate(driver, &sql) != DB_OK) {
2723 db_close_database(driver);
2724diff --git a/vector/v.in.dwg/main.c b/vector/v.in.dwg/main.c
2725index bb7cc63..abde533 100644
2726--- a/vector/v.in.dwg/main.c
2727+++ b/vector/v.in.dwg/main.c
2728@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
2729 initerror, adErrorStr(initerror));
2730 if (initerror == AD_UNABLE_TO_OPEN_INIT_FILE)
2731 sprintf(buf, _("%s Cannot open %s"), buf, path);
2732- G_fatal_error(buf);
2733+ G_fatal_error("%s", buf);
d62d471a 2734 }
705853b0
TP
2735 adSetupDwgRead();
2736 adSetupDxfRead();
2737@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
2738 Fi->table);
d62d471a 2739 }
705853b0
TP
2740 db_set_string(&sql, buf);
2741- G_debug(3, db_get_string(&sql));
2742+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2743
705853b0
TP
2744 if (db_execute_immediate(driver, &sql) != DB_OK) {
2745 db_close_database(driver);
2746diff --git a/vector/v.in.ogr/main.c b/vector/v.in.ogr/main.c
2747index d0d558e..e5b409f 100644
2748--- a/vector/v.in.ogr/main.c
2749+++ b/vector/v.in.ogr/main.c
2750@@ -595,7 +595,7 @@ int main(int argc, char *argv[])
d62d471a
JB
2751 strcat(error_msg,
2752 _("Consider generating a new location with 'location' parameter"
2753 " from input data set.\n"));
2754- G_fatal_error(error_msg);
2755+ G_fatal_error("%s", error_msg);
2756 }
2757 else {
705853b0
TP
2758 G_message(_("Projection of input dataset and current location "
2759@@ -779,7 +779,7 @@ int main(int argc, char *argv[])
d62d471a
JB
2760 G_free(Ogr_fieldname);
2761 }
2762 db_append_string(&sql, ")");
2763- G_debug(3, db_get_string(&sql));
2764+ G_debug(3, "%s", db_get_string(&sql));
2765
2766 driver =
2767 db_start_driver_open_database(Fi->driver,
705853b0 2768@@ -931,7 +931,7 @@ int main(int argc, char *argv[])
d62d471a
JB
2769 db_append_string(&sql, buf);
2770 }
2771 db_append_string(&sql, " )");
2772- G_debug(3, db_get_string(&sql));
2773+ G_debug(3, "%s", db_get_string(&sql));
2774
2775 if (db_execute_immediate(driver, &sql) != DB_OK) {
2776 db_close_database(driver);
705853b0
TP
2777diff --git a/vector/v.in.sites/main.c b/vector/v.in.sites/main.c
2778index 4162c06..66ff3f6 100644
2779--- a/vector/v.in.sites/main.c
2780+++ b/vector/v.in.sites/main.c
2781@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
2782 }
2783 db_append_string(&sql, ")");
d62d471a 2784
705853b0
TP
2785- G_debug(1, db_get_string(&sql));
2786+ G_debug(1, "%s", db_get_string(&sql));
d62d471a 2787
705853b0
TP
2788 driver = db_start_driver(fi->driver);
2789 if (driver == NULL)
2790@@ -232,7 +232,7 @@ int main(int argc, char *argv[])
d62d471a 2791
705853b0 2792 db_append_string(&sql, ")");
d62d471a 2793
705853b0
TP
2794- G_debug(3, db_get_string(&sql));
2795+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2796
705853b0
TP
2797 if (db_execute_immediate(driver, &sql) != DB_OK) {
2798 db_close_database(driver);
2799diff --git a/vector/v.net.allpairs/main.c b/vector/v.net.allpairs/main.c
2800index a92fc96..3d3636b 100644
2801--- a/vector/v.net.allpairs/main.c
2802+++ b/vector/v.net.allpairs/main.c
2803@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
2804 Fi->table);
d62d471a 2805
705853b0
TP
2806 db_set_string(&sql, buf);
2807- G_debug(2, db_get_string(&sql));
2808+ G_debug(2, "%s", db_get_string(&sql));
2809
2810 if (db_execute_immediate(driver, &sql) != DB_OK) {
2811 db_close_database_shutdown_driver(driver);
2812@@ -234,7 +234,7 @@ int main(int argc, char *argv[])
2813 sprintf(buf, "insert into %s values (%d, %d, %f)",
2814 Fi->table, spnode[i].cat, spnode[j].cat, cost);
2815 db_set_string(&sql, buf);
2816- G_debug(3, db_get_string(&sql));
2817+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 2818
705853b0
TP
2819 if (db_execute_immediate(driver, &sql) != DB_OK) {
2820 db_close_database_shutdown_driver(driver);
2821diff --git a/vector/v.net.centrality/main.c b/vector/v.net.centrality/main.c
2822index d5b2fad..79c8629 100644
2823--- a/vector/v.net.centrality/main.c
2824+++ b/vector/v.net.centrality/main.c
2825@@ -233,7 +233,7 @@ int main(int argc, char *argv[])
2826 "create table %s(cat integer%s)", Fi->table, db_get_string(&tmp));
d62d471a 2827
705853b0
TP
2828 db_set_string(&sql, buf);
2829- G_debug(2, db_get_string(&sql));
2830+ G_debug(2, "%s", db_get_string(&sql));
d62d471a 2831
705853b0
TP
2832 if (db_execute_immediate(driver, &sql) != DB_OK) {
2833 db_close_database_shutdown_driver(driver);
2834diff --git a/vector/v.net.components/main.c b/vector/v.net.components/main.c
2835index 6503baa..c8193ef 100644
2836--- a/vector/v.net.components/main.c
2837+++ b/vector/v.net.components/main.c
2838@@ -31,7 +31,7 @@ int insert_new_record(dbDriver * driver, struct field_info *Fi,
d62d471a 2839
705853b0
TP
2840 sprintf(buf, "insert into %s values (%d, %d)", Fi->table, cat, comp);
2841 db_set_string(sql, buf);
2842- G_debug(3, db_get_string(sql));
2843+ G_debug(3, "%s", db_get_string(sql));
d62d471a 2844
705853b0
TP
2845 if (db_execute_immediate(driver, sql) != DB_OK) {
2846 db_close_database_shutdown_driver(driver);
2847@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
2848 sprintf(buf, "create table %s ( cat integer, comp integer)", Fi->table);
d62d471a 2849
d62d471a 2850 db_set_string(&sql, buf);
705853b0
TP
2851- G_debug(2, db_get_string(&sql));
2852+ G_debug(2, "%s", db_get_string(&sql));
d62d471a 2853
705853b0
TP
2854 if (db_execute_immediate(driver, &sql) != DB_OK) {
2855 db_close_database_shutdown_driver(driver);
2856diff --git a/vector/v.net.distance/main.c b/vector/v.net.distance/main.c
2857index cb2a639..4af3e04 100644
2858--- a/vector/v.net.distance/main.c
2859+++ b/vector/v.net.distance/main.c
2860@@ -201,7 +201,7 @@ int main(int argc, char *argv[])
2861 Fi->table);
d62d471a 2862
705853b0
TP
2863 db_set_string(&sql, buf);
2864- G_debug(2, db_get_string(&sql));
2865+ G_debug(2, "%s", db_get_string(&sql));
d62d471a 2866
705853b0
TP
2867 if (db_execute_immediate(driver, &sql) != DB_OK) {
2868 db_close_database_shutdown_driver(driver);
2869@@ -250,7 +250,7 @@ int main(int argc, char *argv[])
2870 tcat, cost);
d62d471a 2871
705853b0
TP
2872 db_set_string(&sql, buf);
2873- G_debug(3, db_get_string(&sql));
2874+ G_debug(3, "%s", db_get_string(&sql));
2875 if (db_execute_immediate(driver, &sql) != DB_OK) {
2876 db_close_database_shutdown_driver(driver);
2877 G_fatal_error(_("Cannot insert new record: %s"),
2878diff --git a/vector/v.net.flow/main.c b/vector/v.net.flow/main.c
2879index d4ea47e..662bba1 100644
2880--- a/vector/v.net.flow/main.c
2881+++ b/vector/v.net.flow/main.c
2882@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
2883 Fi->table);
d62d471a 2884
705853b0
TP
2885 db_set_string(&sql, buf);
2886- G_debug(2, db_get_string(&sql));
2887+ G_debug(2, "%s", db_get_string(&sql));
2888
2889 if (db_execute_immediate(driver, &sql) != DB_OK) {
2890 db_close_database_shutdown_driver(driver);
2891@@ -237,7 +237,7 @@ int main(int argc, char *argv[])
2892 sprintf(buf, "insert into %s values (%d, %f)", Fi->table, cat,
2893 flow[i] / (double)In.cost_multip);
2894 db_set_string(&sql, buf);
2895- G_debug(3, db_get_string(&sql));
2896+ G_debug(3, "%s", db_get_string(&sql));
2897
2898 if (db_execute_immediate(driver, &sql) != DB_OK) {
2899 db_close_database_shutdown_driver(driver);
2900diff --git a/vector/v.net.path/path.c b/vector/v.net.path/path.c
2901index 321e4ad..8cec95f 100644
2902--- a/vector/v.net.path/path.c
2903+++ b/vector/v.net.path/path.c
2904@@ -102,7 +102,7 @@ int path(struct Map_info *In, struct Map_info *Out, char *filename,
2905 Fi->table);
2906
2907 db_set_string(&sql, buf);
2908- G_debug(2, db_get_string(&sql));
2909+ G_debug(2, "%s", db_get_string(&sql));
2910
2911 if (db_execute_immediate(driver, &sql) != DB_OK) {
2912 db_close_database_shutdown_driver(driver);
2913@@ -302,7 +302,7 @@ int path(struct Map_info *In, struct Map_info *Out, char *filename,
2914 "insert into %s values ( %d, %d, %d, %d, %d, %f, %f, %f)",
2915 Fi->table, cat, id, fcat, tcat, sp, cost, fdist, tdist);
2916 db_set_string(&sql, buf);
2917- G_debug(3, db_get_string(&sql));
2918+ G_debug(3, "%s", db_get_string(&sql));
2919
2920 if (db_execute_immediate(driver, &sql) != DB_OK) {
2921 db_close_database_shutdown_driver(driver);
2922diff --git a/vector/v.net.timetable/main.c b/vector/v.net.timetable/main.c
2923index dc5acdc..f979c2f 100644
2924--- a/vector/v.net.timetable/main.c
2925+++ b/vector/v.net.timetable/main.c
2926@@ -96,7 +96,7 @@ void init_database(struct Map_info *Out, dbDriver ** driver,
2927 sprintf(buf, "create table %s (%s)", (*Fi)->table, columns);
2928
2929 db_set_string(&sql, buf);
2930- G_debug(2, db_get_string(&sql));
2931+ G_debug(2, "%s", db_get_string(&sql));
2932
2933 if (db_execute_immediate(*driver, &sql) != DB_OK) {
2934 db_close_database_shutdown_driver(*driver);
2935@@ -128,7 +128,7 @@ void insert_point(dbDriver * driver, char *table, int cat, int path,
2936 sprintf(buf, "insert into %s values (%d, %d, %d, %d, %d, %d)", table, cat,
2937 path, stop_id, index, arrival_time, departure_time);
2938 db_set_string(&sql, buf);
2939- G_debug(3, db_get_string(&sql));
2940+ G_debug(3, "%s", db_get_string(&sql));
2941 if (db_execute_immediate(driver, &sql) != DB_OK) {
2942 db_close_database_shutdown_driver(driver);
2943 G_fatal_error(_("Cannot insert new record: %s"), db_get_string(&sql));
2944@@ -150,7 +150,7 @@ void insert_line(dbDriver * driver, char *table, int cat, int path,
2945 table, cat, path, from_id, to_id, route_id, index, from_time,
2946 to_time);
2947 db_set_string(&sql, buf);
2948- G_debug(3, db_get_string(&sql));
2949+ G_debug(3, "%s", db_get_string(&sql));
2950 if (db_execute_immediate(driver, &sql) != DB_OK) {
2951 db_close_database_shutdown_driver(driver);
2952 G_fatal_error(_("Cannot insert new record: %s"), db_get_string(&sql));
2953diff --git a/vector/v.overlay/area_area.c b/vector/v.overlay/area_area.c
2954index e8f4382..da6f02f 100644
2955--- a/vector/v.overlay/area_area.c
2956+++ b/vector/v.overlay/area_area.c
2957@@ -339,7 +339,7 @@ int area_area(struct Map_info *In, int *field, struct Map_info *Out,
2958
2959 db_append_string(&stmt, " )");
2960
2961- G_debug(3, db_get_string(&stmt));
2962+ G_debug(3, "%s", db_get_string(&stmt));
2963
2964 if (db_execute_immediate(driver, &stmt) != DB_OK)
2965 G_warning(_("Unable to insert new record: '%s'"),
2966diff --git a/vector/v.overlay/line_area.c b/vector/v.overlay/line_area.c
2967index 3b35138..92e0560 100644
2968--- a/vector/v.overlay/line_area.c
2969+++ b/vector/v.overlay/line_area.c
2970@@ -212,7 +212,7 @@ int line_area(struct Map_info *In, int *field, struct Map_info *Out,
2971
2972 db_append_string(&stmt, " )");
2973
2974- G_debug(3, db_get_string(&stmt));
2975+ G_debug(3, "%s", db_get_string(&stmt));
2976
2977 if (db_execute_immediate(driver, &stmt) != DB_OK)
2978 G_warning(_("Unable to insert new record: '%s'"),
2979diff --git a/vector/v.overlay/main.c b/vector/v.overlay/main.c
2980index ea87580..a6ab830 100644
2981--- a/vector/v.overlay/main.c
2982+++ b/vector/v.overlay/main.c
2983@@ -517,7 +517,7 @@ int main(int argc, char *argv[])
2984
2985 db_append_string(&stmt, " )");
2986
2987- G_debug(3, db_get_string(&stmt));
2988+ G_debug(3, "%s", db_get_string(&stmt));
2989
2990 if (db_execute_immediate(driver, &stmt) != DB_OK) {
2991 Vect_close(&Out);
2992diff --git a/vector/v.random/main.c b/vector/v.random/main.c
2993index e68ffbd..08b38ac 100644
2994--- a/vector/v.random/main.c
2995+++ b/vector/v.random/main.c
2996@@ -185,7 +185,7 @@ int main(int argc, char *argv[])
2997 Fi->driver);
2998
2999 /* Create table */
3000- G_debug(3, db_get_string(&sql));
3001+ G_debug(3, "%s", db_get_string(&sql));
3002 if (db_execute_immediate(driver, &sql) != DB_OK) {
d62d471a
JB
3003 db_close_database(driver);
3004 db_shutdown_driver(driver);
705853b0
TP
3005@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
3006 sprintf(buf, "%.0f )", z);
3007 db_append_string(&sql, buf);
d62d471a 3008
705853b0
TP
3009- G_debug(3, db_get_string(&sql));
3010+ G_debug(3, "%s", db_get_string(&sql));
3011 if (db_execute_immediate(driver, &sql) != DB_OK) {
3012 db_close_database(driver);
3013 db_shutdown_driver(driver);
3014diff --git a/vector/v.surf.rst/main.c b/vector/v.surf.rst/main.c
3015index 88dfdd0..a21db40 100644
3016--- a/vector/v.surf.rst/main.c
3017+++ b/vector/v.surf.rst/main.c
3018@@ -601,7 +601,7 @@ int main(int argc, char *argv[])
3019 db_append_string(&sql2, "cat integer");
3020 db_append_string(&sql2, ", flt1 double precision");
3021 db_append_string(&sql2, ")");
3022- G_debug(1, db_get_string(&sql2));
3023+ G_debug(1, "%s", db_get_string(&sql2));
3024 driver2 = db_start_driver_open_database(ff->driver, ff->database);
3025 if (driver2 == NULL)
3026 G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
3027@@ -920,5 +920,5 @@ void clean_fatal_error(char *str)
3028 fclose(Tmp_fd_xy);
3029 unlink(Tmp_file_xy);
d62d471a 3030 }
705853b0
TP
3031- G_fatal_error(str);
3032+ G_fatal_error("%s", str);
3033 }
3034diff --git a/vector/v.vol.rst/main.c b/vector/v.vol.rst/main.c
3035index 2d25b4e..ff7cc5e 100644
3036--- a/vector/v.vol.rst/main.c
3037+++ b/vector/v.vol.rst/main.c
3038@@ -584,7 +584,7 @@ int main(int argc, char *argv[])
3039 db_append_string(&sql, "cat integer");
3040 db_append_string(&sql, ", flt1 double precision");
3041 db_append_string(&sql, ")");
3042- G_debug(1, db_get_string(&sql));
3043+ G_debug(1, "%s", db_get_string(&sql));
3044 driver = db_start_driver_open_database(f->driver, f->database);
3045 if (driver == NULL)
3046 G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
3047diff --git a/vector/v.vol.rst/user4.c b/vector/v.vol.rst/user4.c
3048index 3ff3fbf..8067f44 100644
3049--- a/vector/v.vol.rst/user4.c
3050+++ b/vector/v.vol.rst/user4.c
3051@@ -74,7 +74,7 @@ void clean_fatal_error(char *str)
3052 fclose(Tmp_fd_xy);
3053 unlink(Tmp_file_xy);
d62d471a 3054 }
705853b0
TP
3055- G_fatal_error(str);
3056+ G_fatal_error("%s", str);
3057 }
d62d471a 3058
d62d471a 3059
705853b0
TP
3060diff --git a/vector/v.vol.rst/vector.c b/vector/v.vol.rst/vector.c
3061index fb3efed..16b0965 100644
3062--- a/vector/v.vol.rst/vector.c
3063+++ b/vector/v.vol.rst/vector.c
3064@@ -72,7 +72,7 @@ int point_save(double xmm, double ymm, double zmm, double err)
3065 sprintf(buf, ", %f", err);
3066 db_append_string(&sql, buf);
3067 db_append_string(&sql, ")");
3068- G_debug(3, db_get_string(&sql));
3069+ G_debug(3, "%s", db_get_string(&sql));
d62d471a 3070
705853b0
TP
3071 if (db_execute_immediate(driver, &sql) != DB_OK) {
3072 db_close_database(driver);
3073diff --git a/vector/v.what.rast/main.c b/vector/v.what.rast/main.c
3074index 189bbac..a668191 100644
3075--- a/vector/v.what.rast/main.c
3076+++ b/vector/v.what.rast/main.c
3077@@ -178,7 +178,7 @@ int main(int argc, char *argv[])
d62d471a 3078
705853b0 3079 nlines = Vect_get_num_lines(&Map);
d62d471a 3080
705853b0
TP
3081- G_debug(1, "Reading %d vector features fom map", nlines);
3082+ G_debug(1, "%s", "Reading %d vector features fom map", nlines);
d62d471a 3083
705853b0
TP
3084 for (i = 1; i <= nlines; i++) {
3085 type = Vect_read_line(&Map, Points, Cats, i);
3086@@ -351,7 +351,7 @@ int main(int argc, char *argv[])
3087 sprintf(buf, " AND %s", where_opt->answer);
3088 db_append_string(&stmt, buf);
3089 }
3090- G_debug(3, db_get_string(&stmt));
3091+ G_debug(3, "%s", db_get_string(&stmt));
3092
3093 /* Update table */
3094 if (db_execute_immediate(driver, &stmt) == DB_OK) {
3095--
30961.9.3
3097
This page took 0.485246 seconds and 4 git commands to generate.