[packages/grass] - initial update to grass70 series, version 7.0.3 (6.4.x series left on grass-6.4 branch) - updaed a

qboosh qboosh at pld-linux.org
Thu Apr 14 19:42:46 CEST 2016


commit 91be88b5cf0b64f6d801d5d1f250a0edc913dac4
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Apr 14 19:42:25 2016 +0200

    - initial update to grass70 series, version 7.0.3 (6.4.x series left on grass-6.4 branch)
    - updaed ac,format,soname patches
    - removed outdated ncurses and ffmpeg patches (grass now calls ffmpeg program instead of using ffmpeg API)
    - tcl/tk componenta are gone, now there is only wxPython based GUI

 grass-ac.patch     |  246 ++---
 grass-ffmpeg.patch |  126 ---
 grass-format.patch | 3124 +---------------------------------------------------
 grass-soname.patch |   10 +-
 grass.spec         |  299 ++---
 ncurses.patch      |   15 -
 6 files changed, 217 insertions(+), 3603 deletions(-)
---
diff --git a/grass.spec b/grass.spec
index 94ff141..fdb32e7 100644
--- a/grass.spec
+++ b/grass.spec
@@ -1,41 +1,32 @@
 # TODO
-# - use system tk-BWidget instead of bundled 1.2.1 (lib/external/bwidget)
 # - openDWG
 #
 # Conditional build, see http://grass.itc.it/grass61/source/REQUIREMENTS.html
 # for description of optional requirements.
-%bcond_without	tcl	# GUI and nviz
 %bcond_without	mysql	# MySQL support
 %bcond_without	odbc	# unixODBC support
-%bcond_without	glw	# GLw interface
-%bcond_without	xanim	# xanim module
 
 Summary:	The Geographic Resources Analysis Support System
 Summary(pl.UTF-8):	System obsługujący analizę zasobów geograficznych
 Name:		grass
-Version:	6.4.5
+Version:	7.0.3
 Release:	1
 Epoch:		1
 License:	GPL v2+
 Group:		X11/Applications
-Source0:	http://grass.osgeo.org/grass64/source/%{name}-%{version}.tar.gz
-# Source0-md5:	c58ab8db635ebd06cfd93dce7b70b6cb
+Source0:	http://grass.osgeo.org/grass70/source/%{name}-%{version}.tar.gz
+# Source0-md5:	dfbd39829036ee2d59b13c35a183ec0e
 Patch0:		%{name}-soname.patch
-Patch1:		ncurses.patch
-Patch2:		%{name}-ffmpeg.patch
-Patch3:		%{name}-ac.patch
-Patch4:		%{name}-format.patch
-Patch5:		%{name}-ctypesgen.patch
+Patch1:		%{name}-ac.patch
+Patch2:		%{name}-format.patch
+Patch3:		%{name}-ctypesgen.patch
 URL:		http://grass.osgeo.org/
-%{?with_tcl:BuildRequires:	OpenGL-GLU-devel}
-%{?with_glw:BuildRequires:	OpenGL-GLw-devel}
+BuildRequires:	OpenGL-GLU-devel
 BuildRequires:	autoconf >= 2.13
 BuildRequires:	automake
 BuildRequires:	bison
 BuildRequires:	blas-devel
 BuildRequires:	cairo-devel
-# libavcodec libavformat libavutil libswscale
-BuildRequires:	ffmpeg-devel
 BuildRequires:	fftw3-devel >= 3
 BuildRequires:	flex
 BuildRequires:	freetype-devel >= 2.0.0
@@ -51,9 +42,7 @@ BuildRequires:	libstdc++-devel
 BuildRequires:	libtiff-devel
 # man or man-db
 BuildRequires:	/usr/bin/man
-%{?with_xanim:BuildRequires:	motif-devel}
 %{?with_mysql:BuildRequires:	mysql-devel}
-BuildRequires:	ncurses-devel
 BuildRequires:	pkgconfig
 BuildRequires:	postgresql-backend-devel
 BuildRequires:	postgresql-devel
@@ -64,8 +53,6 @@ BuildRequires:	python-wxPython
 BuildRequires:	readline-devel
 BuildRequires:	sed >= 4.0
 BuildRequires:	sqlite3-devel >= 3.0
-%{?with_tcl:BuildRequires:	tcl-devel >= 8.4}
-%{?with_tcl:BuildRequires:	tk-devel >= 8.4}
 %{?with_odbc:BuildRequires:	unixODBC-devel}
 BuildRequires:	wxGTK2-unicode-devel >= 2.8.1
 BuildRequires:	xorg-lib-libX11-devel
@@ -163,17 +150,18 @@ Pliki nagłówkowe i biblioteki statyczne systemu GRASS.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-%patch4 -p1
-%patch5 -p1
 
-cp -f lib/external/bwidget/CHANGES.txt bwidget.CHANGES.TXT
-cp -f lib/external/bwidget/README.grass bwidget.README.grass
+%{__sed} -i -e '1s,/usr/bin/env perl,%{__perl},' \
+	display/d.text/test.pl
+	raster/r.topidx/gridatb.to.arc.pl \
+	raster/r.topidx/arc.to.gridatb.pl
+
+find general gui imagery lib/python/pygrass lib/init raster scripts temporal tools -name '*.py' | xargs grep -l '/usr/bin/env python' | xargs %{__sed} -i -e '1s,/usr/bin/env python,%{__python},'
 
 %build
 %{__libtoolize}
 %{__aclocal}
 %{__autoconf}
-CPPFLAGS="-I/usr/include/ncurses"
 %configure \
 %if "%{_lib}" == "lib64"
         --enable-64bit \
@@ -184,26 +172,20 @@ CPPFLAGS="-I/usr/include/ncurses"
 	--with-blas \
 	--with-cairo \
 	--with-cxx \
-	--with-ffmpeg \
-	--with-ffmpeg-includes='/usr/include/libavcodec /usr/include/libavformat /usr/include/libswscale' \
 	--with-freetype \
 	--with-freetype-includes=/usr/include/freetype2 \
 	--with-geos=/usr/bin/geos-config \
-	%{?with_glw:--with-glw} \
 	--with-lapack \
-	%{?with_xanim:--with-motif} \
 	%{?with_mysql:--with-mysql} \
 	%{?with_mysql:--with-mysql-includes=/usr/include/mysql} \
 	--with-nls \
 	%{?with_odbc:--with-odbc} \
-	--with%{!?with_tcl:out}-opengl \
+	--with-opengl \
 	--with-postgres \
 	--with-postgres-includes=/usr/include/postgresql/server \
 	--with-proj-share=/usr/share/proj \
-	--with-python \
 	--with-readline \
 	--with-sqlite \
-	--with%{!?with_tcl:out}-tcltk \
 	--with-wxwidgets=/usr/bin/wx-gtk2-unicode-config
 
 %{__make}
@@ -216,15 +198,18 @@ rm -rf $RPM_BUILD_ROOT
 	BINDIR=$RPM_BUILD_ROOT%{_bindir} \
 	PREFIX=$RPM_BUILD_ROOT%{_libdir}
 
-install -d $RPM_BUILD_ROOT{%{_datadir},%{_includedir}/grass64}
-%{__mv} $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/include/* $RPM_BUILD_ROOT%{_includedir}/grass64
+install -d $RPM_BUILD_ROOT{%{_datadir},%{_includedir}/grass70}
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/include/* $RPM_BUILD_ROOT%{_includedir}/grass70
 %{__mv} $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/lib/* $RPM_BUILD_ROOT%{_libdir}
 %{__mv} $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/locale $RPM_BUILD_ROOT%{_datadir}
-%{__mv} $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/man $RPM_BUILD_ROOT%{_datadir}
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/docs/man $RPM_BUILD_ROOT%{_datadir}
+%{__mv} $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/share/{appdata,applications,icons} $RPM_BUILD_ROOT%{_datadir}
 
-sed -i -e 's,^GISBASE=.*,GISBASE=%{_libdir}/grass-%{gver},' $RPM_BUILD_ROOT%{_bindir}/grass64
+# these manual cover topics, not programs, so shouldn't exist in section 1
+# (maybe in section 7, but names are too common anyway); keep HTML version only
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{cairodriver,database,databaseintro,display,displaydrivers,full_index,general,helptext,htmldriver,imagery,imageryintro,index,keywords,misc,pngdriver,postscript,projectionintro,psdriver,raster,rasterintro,raster3d,raster3dintro,sql,temporal,temporalintro,topics,variables,vector,vectorascii,vectorintro}.1
 
-%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/{bwidget/{*.txt,README.grass},docs}
+%{__rm} -r $RPM_BUILD_ROOT%{_libdir}/grass-%{gver}/docs
 
 %{__mv} $RPM_BUILD_ROOT%{_datadir}/locale/{pt_br,pt_BR}
 %{__mv} $RPM_BUILD_ROOT%{_datadir}/locale/{zh,zh_CN}
@@ -245,222 +230,120 @@ rm -rf $RPM_BUILD_ROOT
 
 %files -f %{name}.lang
 %defattr(644,root,root,755)
-%doc AUTHORS CHANGES COPYING README TODO bwidget.CHANGES.TXT bwidget.README.grass
-#%doc dist.%{_target_platform}/docs/html
-%attr(755,root,root) %{_bindir}/gem64
-%attr(755,root,root) %{_bindir}/grass64
+%doc AUTHORS CHANGES COPYING README TODO
+#%attr(755,root,root) %{_bindir}/grass70
 %attr(755,root,root) %{_libdir}/libgrass_*.%{version}.so
 %dir %{_libdir}/grass-%{gver}
 %dir %{_libdir}/grass-%{gver}/*.csv
+%attr(755,root,root) %{_libdir}/grass-%{gver}/config.status
 %attr(755,root,root) %{_libdir}/grass-%{gver}/bin
-%dir %{_libdir}/grass-%{gver}/bwidget
-%{_libdir}/grass-%{gver}/bwidget/*.tcl
-%{_libdir}/grass-%{gver}/bwidget/images
-%dir %{_libdir}/grass-%{gver}/bwidget/lang
-%lang(de) %{_libdir}/grass-%{gver}/bwidget/lang/de.rc
-%{_libdir}/grass-%{gver}/bwidget/lang/en.rc
-%lang(es) %{_libdir}/grass-%{gver}/bwidget/lang/es.rc
-%lang(fr) %{_libdir}/grass-%{gver}/bwidget/lang/fr.rc
 %attr(755,root,root) %{_libdir}/grass-%{gver}/driver
 %dir %{_libdir}/grass-%{gver}/etc
-%{_libdir}/grass-%{gver}/etc/FIPS.code
 %{_libdir}/grass-%{gver}/etc/VERSIONNUMBER
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/Init.sh
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/bmif_to_cell
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/clean_temp
 %{_libdir}/grass-%{gver}/etc/colors
 %{_libdir}/grass-%{gver}/etc/colors.desc
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/current_time_s_ms
 %{_libdir}/grass-%{gver}/etc/d.polar
-%{_libdir}/grass-%{gver}/etc/d.rast.edit.tcl
-%{_libdir}/grass-%{gver}/etc/datum*.table
 %{_libdir}/grass-%{gver}/etc/db.test
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/echo
 %{_libdir}/grass-%{gver}/etc/element_list
-%{_libdir}/grass-%{gver}/etc/ellipse.table
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/epsg_option.tcl
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/file_option.tcl
 %{_libdir}/grass-%{gver}/etc/fontcap
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/frame.*
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/g.mapsets.tcl
-%{_libdir}/grass-%{gver}/etc/gem
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/gis_set.tcl
-%{_libdir}/grass-%{gver}/etc/grass-interface.dtd
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/grass-run.sh
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/grass-xterm-wrapper
-%{_libdir}/grass-%{gver}/etc/grass_intro
-%{_libdir}/grass-%{gver}/etc/grass_write_ascii.style
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/grocat
-%{_libdir}/grass-%{gver}/etc/gtcltk
-%dir %{_libdir}/grass-%{gver}/etc/gui
-%{_libdir}/grass-%{gver}/etc/gui/icons
-%{_libdir}/grass-%{gver}/etc/gui/images
-%dir %{_libdir}/grass-%{gver}/etc/gui/scripts
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/gui/scripts/*
-%{_libdir}/grass-%{gver}/etc/gui.tcl
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/i.ask
+%{_libdir}/grass-%{gver}/etc/grass70.py
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/i.find
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/i.oif
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/i.photo.*
 %{_libdir}/grass-%{gver}/etc/license
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/lister
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/lock
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/modcats
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/modcolr
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/modhead
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/modhist
-%{_libdir}/grass-%{gver}/etc/monitorcap
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/mon.*
-%dir %{_libdir}/grass-%{gver}/etc/msgs
-%lang(am) %{_libdir}/grass-%{gver}/etc/msgs/am.msg
-%lang(ar) %{_libdir}/grass-%{gver}/etc/msgs/ar.msg
-%lang(cs) %{_libdir}/grass-%{gver}/etc/msgs/cs.msg
-%lang(de) %{_libdir}/grass-%{gver}/etc/msgs/de.msg
-%lang(el) %{_libdir}/grass-%{gver}/etc/msgs/el.msg
-%lang(es) %{_libdir}/grass-%{gver}/etc/msgs/es.msg
-%lang(fr) %{_libdir}/grass-%{gver}/etc/msgs/fr.msg
-%lang(hi) %{_libdir}/grass-%{gver}/etc/msgs/hi.msg
-%lang(id) %{_libdir}/grass-%{gver}/etc/msgs/id.msg
-%lang(it) %{_libdir}/grass-%{gver}/etc/msgs/it.msg
-%lang(ja) %{_libdir}/grass-%{gver}/etc/msgs/ja.msg
-%lang(ko) %{_libdir}/grass-%{gver}/etc/msgs/ko.msg
-%lang(lv) %{_libdir}/grass-%{gver}/etc/msgs/lv.msg
-%lang(mr) %{_libdir}/grass-%{gver}/etc/msgs/mr.msg
-%lang(nl) %{_libdir}/grass-%{gver}/etc/msgs/nl.msg
-%lang(pl) %{_libdir}/grass-%{gver}/etc/msgs/pl.msg
-%lang(pt) %{_libdir}/grass-%{gver}/etc/msgs/pt.msg
-%lang(pt_BR) %{_libdir}/grass-%{gver}/etc/msgs/pt_br.msg
-%lang(ru) %{_libdir}/grass-%{gver}/etc/msgs/ru.msg
-%lang(sl) %{_libdir}/grass-%{gver}/etc/msgs/sl.msg
-%lang(th) %{_libdir}/grass-%{gver}/etc/msgs/th.msg
-%lang(tr) %{_libdir}/grass-%{gver}/etc/msgs/tr.msg
-%lang(vi) %{_libdir}/grass-%{gver}/etc/msgs/vi.msg
-%lang(zh_CN) %{_libdir}/grass-%{gver}/etc/msgs/zh.msg
-%{_libdir}/grass-%{gver}/etc/nad
-%{_libdir}/grass-%{gver}/etc/ogr_csv
 %{_libdir}/grass-%{gver}/etc/paint
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/poly_to_bmif
-%{_libdir}/grass-%{gver}/etc/proj-*.table
-%{_libdir}/grass-%{gver}/etc/projections
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/prompt.sh
+%{_libdir}/grass-%{gver}/etc/proj
 %{_libdir}/grass-%{gver}/etc/psdriver.ps
 %{_libdir}/grass-%{gver}/etc/python
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.in.wms
-%dir %{_libdir}/grass-%{gver}/etc/r.li.setup
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.li.setup/area_query
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.li.setup/masked_area_selection.sh
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.li.setup/r.li.*
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.li.setup/sample_area_vector.sh
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.li.setup/square_*
-%{_libdir}/grass-%{gver}/etc/r.li.setup/*.txt
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.watershed.*
+%dir %{_libdir}/grass-%{gver}/etc/r.watershed
+%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.watershed/ram
+%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/r.watershed/seg
+%{_libdir}/grass-%{gver}/etc/renamed_options
 %attr(755,root,root) %{_libdir}/grass-%{gver}/etc/run
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/set_data
-%{_libdir}/grass-%{gver}/etc/state*
+%{_libdir}/grass-%{gver}/etc/sql
 %{_libdir}/grass-%{gver}/etc/symbol
-%{_libdir}/grass-%{gver}/etc/v.digit
-%{_libdir}/grass-%{gver}/etc/welcome
-%dir %{_libdir}/grass-%{gver}/etc/wxpython
-%{_libdir}/grass-%{gver}/etc/wxpython/README
-%{_libdir}/grass-%{gver}/etc/wxpython/compat
-%{_libdir}/grass-%{gver}/etc/wxpython/core
-%{_libdir}/grass-%{gver}/etc/wxpython/dbmgr
-%{_libdir}/grass-%{gver}/etc/wxpython/gcp
-%{_libdir}/grass-%{gver}/etc/wxpython/gmodeler
-%{_libdir}/grass-%{gver}/etc/wxpython/gui_core
-%{_libdir}/grass-%{gver}/etc/wxpython/icons
-%{_libdir}/grass-%{gver}/etc/wxpython/lmgr
-%{_libdir}/grass-%{gver}/etc/wxpython/location_wizard
-%{_libdir}/grass-%{gver}/etc/wxpython/mapdisp
-%{_libdir}/grass-%{gver}/etc/wxpython/modules
-%{_libdir}/grass-%{gver}/etc/wxpython/nviz
-%{_libdir}/grass-%{gver}/etc/wxpython/psmap
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/wxpython/scripts
-%{_libdir}/grass-%{gver}/etc/wxpython/vdigit
-%{_libdir}/grass-%{gver}/etc/wxpython/wxplot
-%{_libdir}/grass-%{gver}/etc/wxpython/xml
-%{_libdir}/grass-%{gver}/etc/wxpython/gis_set.py*
-%{_libdir}/grass-%{gver}/etc/wxpython/wxgui.py*
+%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/wxpyimgview_gui.py
 %{_libdir}/grass-%{gver}/fonts
+%dir %{_libdir}/grass-%{gver}/gui
+%{_libdir}/grass-%{gver}/gui/icons
+%{_libdir}/grass-%{gver}/gui/images
+%dir %{_libdir}/grass-%{gver}/gui/scripts
+%attr(755,root,root) %{_libdir}/grass-%{gver}/gui/scripts/d.*
+%dir %{_libdir}/grass-%{gver}/gui/wxpython
+%{_libdir}/grass-%{gver}/gui/wxpython/README
+%{_libdir}/grass-%{gver}/gui/wxpython/animation
+%{_libdir}/grass-%{gver}/gui/wxpython/core
+%{_libdir}/grass-%{gver}/gui/wxpython/dbmgr
+%{_libdir}/grass-%{gver}/gui/wxpython/gcp
+%{_libdir}/grass-%{gver}/gui/wxpython/gmodeler
+%{_libdir}/grass-%{gver}/gui/wxpython/gui_core
+%{_libdir}/grass-%{gver}/gui/wxpython/iclass
+%{_libdir}/grass-%{gver}/gui/wxpython/icons
+%{_libdir}/grass-%{gver}/gui/wxpython/iscatt
+%{_libdir}/grass-%{gver}/gui/wxpython/lmgr
+%{_libdir}/grass-%{gver}/gui/wxpython/location_wizard
+%{_libdir}/grass-%{gver}/gui/wxpython/mapdisp
+%{_libdir}/grass-%{gver}/gui/wxpython/mapswipe
+%{_libdir}/grass-%{gver}/gui/wxpython/mapwin
+%{_libdir}/grass-%{gver}/gui/wxpython/modules
+%{_libdir}/grass-%{gver}/gui/wxpython/nviz
+%{_libdir}/grass-%{gver}/gui/wxpython/psmap
+%{_libdir}/grass-%{gver}/gui/wxpython/rlisetup
+%{_libdir}/grass-%{gver}/gui/wxpython/timeline
+%{_libdir}/grass-%{gver}/gui/wxpython/tplot
+%{_libdir}/grass-%{gver}/gui/wxpython/vdigit
+%{_libdir}/grass-%{gver}/gui/wxpython/vnet
+%{_libdir}/grass-%{gver}/gui/wxpython/web_services
+%{_libdir}/grass-%{gver}/gui/wxpython/wxplot
+%{_libdir}/grass-%{gver}/gui/wxpython/xml
+%{_libdir}/grass-%{gver}/gui/wxpython/gis_set*.py*
+%{_libdir}/grass-%{gver}/gui/wxpython/wxgui.py*
+%{_libdir}/grass-%{gver}/gui/xml
 %attr(755,root,root) %{_libdir}/grass-%{gver}/scripts
 %dir %{_libdir}/grass-%{gver}/tools
 %attr(755,root,root) %{_libdir}/grass-%{gver}/tools/g.echo
-%attr(755,root,root) %{_libdir}/grass-%{gver}/tools/g.html2man
-%attr(755,root,root) %{_libdir}/grass-%{gver}/tools/mkhtml.sh
-%{_mandir}/man1/cairodriver.1*
+%attr(755,root,root) %{_libdir}/grass-%{gver}/tools/g.html2man.py
+%{_libdir}/grass-%{gver}/tools/groff.py*
+%{_libdir}/grass-%{gver}/tools/html.py*
+%attr(755,root,root) %{_libdir}/grass-%{gver}/tools/mkhtml.py
+%{_libdir}/grass-%{gver}/translation_status.json
+# default (demo?) database - subpackage?
+%{_libdir}/grass-%{gver}/demolocation
+%{_datadir}/appdata/grass.appdata.xml
+%{_desktopdir}/grass.desktop
+%{_iconsdir}/hicolor/*x*/apps/grass70.png
+%{_iconsdir}/hicolor/scalable/apps/grass70.svg
 %{_mandir}/man1/d.*.1*
-%{_mandir}/man1/databaseintro.1*
 %{_mandir}/man1/db.*.1*
-%{_mandir}/man1/displaydrivers.1*
 %{_mandir}/man1/g.*.1*
-%{_mandir}/man1/gis.m.1*
-%{_mandir}/man1/gm_*.1*
-%{_mandir}/man1/grass6.1*
+%{_mandir}/man1/grass7.1*
 %{_mandir}/man1/grass-*.1*
-%{_mandir}/man1/helptext.1*
-%{_mandir}/man1/htmlmapdriver.1*
 %{_mandir}/man1/i.*.1*
-%{_mandir}/man1/imageryintro.1*
 %{_mandir}/man1/lrs.1*
 %{_mandir}/man1/m.*.1*
-%{_mandir}/man1/mkftcap.1*
-%{_mandir}/man1/modcats.1*
-%{_mandir}/man1/modcolr.1*
-%{_mandir}/man1/modhead.1*
-%{_mandir}/man1/modhist.1*
-%{_mandir}/man1/nviz.1*
-%{_mandir}/man1/p.out.vrml.1*
-%{_mandir}/man1/pngdriver.1*
-%{_mandir}/man1/projectionintro.1*
-%{_mandir}/man1/psdriver.1*
 %{_mandir}/man1/ps.map.1*
 %{_mandir}/man1/r.*.1*
 %{_mandir}/man1/r3.*.1*
-%{_mandir}/man1/raster3dintro.1*
-%{_mandir}/man1/rasterintro.1*
-%{_mandir}/man1/sql.1*
+%{_mandir}/man1/t.*.1*
+%{_mandir}/man1/topic_*.1*
 %{_mandir}/man1/v.*.1*
-%{_mandir}/man1/variables.1*
-%{_mandir}/man1/vectorintro.1*
+%{_mandir}/man1/wximgview.1*
+%{_mandir}/man1/wxpyimgview.1*
 %{_mandir}/man1/wxGUI*.1*
-%{_mandir}/man1/xdriver.1*
-%{_mandir}/man1/xganim.1*
-
-%if %{with tcl}
-%dir %{_libdir}/grass-%{gver}/etc/dm
-%{_libdir}/grass-%{gver}/etc/dm/*.gif
-%{_libdir}/grass-%{gver}/etc/dm/[!d]*.tcl
-%{_libdir}/grass-%{gver}/etc/dm/d[!.]*.tcl
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/dm/d.m.tcl
-%dir %{_libdir}/grass-%{gver}/etc/dm/script
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/dm/script/*
-%dir %{_libdir}/grass-%{gver}/etc/form
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/form/form
-%{_libdir}/grass-%{gver}/etc/form/*.tcl
-%dir %{_libdir}/grass-%{gver}/etc/gm
-%{_libdir}/grass-%{gver}/etc/gm/intro.gif
-%{_libdir}/grass-%{gver}/etc/gm/*.tcl
-%dir %{_libdir}/grass-%{gver}/etc/nviz2.2
-%{_libdir}/grass-%{gver}/etc/nviz2.2/bitmaps
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/nviz2.2/nviz
-%dir %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs
-%lang(de) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/de.msg
-%lang(fr) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/fr.msg
-%lang(it) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/it.msg
-%lang(ja) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/ja.msg
-%lang(lv) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/lv.msg
-%lang(nl) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/nl.msg
-%lang(pl) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/pl.msg
-%lang(ro) %{_libdir}/grass-%{gver}/etc/nviz2.2/msgs/ro.msg
-%dir %{_libdir}/grass-%{gver}/etc/nviz2.2/scripts
-%attr(755,root,root) %{_libdir}/grass-%{gver}/etc/nviz2.2/scripts/*
-%endif
+%{_mandir}/man1/ximgview.1*
 
 %files devel
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/libgrass_*[!0-9].so
+%attr(755,root,root) %{_libdir}/libgrass_btree2.so
 %attr(755,root,root) %{_libdir}/libgrass_dig2.so
 %{_libdir}/libgrass_iostream.%{version}.a
-%{_libdir}/libgrass_ismap.%{version}.a
-%{_libdir}/libgrass_manage.%{version}.a
-%{_includedir}/grass64
+%{_includedir}/grass70
+
+%files doc
+%defattr(644,root,root,755)
+%doc dist.*/docs/html/*
diff --git a/grass-ac.patch b/grass-ac.patch
index 7985b8e..dab9e48 100644
--- a/grass-ac.patch
+++ b/grass-ac.patch
@@ -1,23 +1,14 @@
---- grass-6.4.2/lib/gis/Makefile.orig	2011-03-10 10:54:19.000000000 +0100
-+++ grass-6.4.2/lib/gis/Makefile	2012-10-20 14:32:27.320283161 +0200
-@@ -12,7 +12,7 @@
+--- grass-7.0.3/lib/gis/Makefile.orig	2016-04-03 19:35:16.596262959 +0200
++++ grass-7.0.3/lib/gis/Makefile	2016-04-03 21:12:20.269351895 +0200
+@@ -22,7 +22,7 @@
  
- LIB_OBJS := $(subst .c,.o,$(wildcard *.c))
- LIB_OBJS := $(filter-out fmode.o dllmain.o,$(LIB_OBJS))
--ifneq ($(MINGW),)
-+ifeq ($(MINGW),yes)
- LIB_OBJS := $(LIB_OBJS) dllmain.o fmode.o
- endif
+ default: lib $(FMODE_OBJ) $(PROJFILES) $(COLORFILES) $(ETC)/colors.desc $(ETC)/renamed_options
  
-@@ -34,7 +34,7 @@
- 
- ifneq ($(GDAL_DYNAMIC),)
- EXTRA_CFLAGS += -DGDAL_DYNAMIC=1
--ifneq ($(MINGW),)
+-ifdef MINGW
 +ifeq ($(MINGW),yes)
- EXTRA_LIBS += -lkernel32
- else
- EXTRA_LIBS += $(DLLIB)
+ $(FMODE_OBJ): $(OBJDIR)/fmode.o
+ 	$(INSTALL) $< $@
+ endif
 --- grass-6.4.2/lib/init/Makefile.orig	2011-06-08 12:30:46.000000000 +0200
 +++ grass-6.4.2/lib/init/Makefile	2012-10-20 14:33:08.316948107 +0200
 @@ -60,7 +60,7 @@
@@ -29,161 +20,88 @@
  	FILES += \
  		$(ETC)/Init.bat \
  		$(ETC)/winlocale$(EXE) \
---- grass-6.4.2/Makefile.orig	2011-05-13 21:01:14.000000000 +0200
-+++ grass-6.4.2/Makefile	2012-10-20 14:34:32.893611225 +0200
-@@ -49,7 +49,7 @@
- 	man \
- 	macosx
- 
--ifeq ($(strip $(MINGW)),)
-+ifneq ($(strip $(MINGW)),yes)
- 	SUBDIRS += gem
- endif
- 
-@@ -115,7 +115,7 @@
- 	@if [ `cat "$(ERRORLOG)" | wc -l` -gt 8 ] ; then false ; else true ; fi
- 
- manifests:
--ifneq ($(strip $(MINGW)),)
-+ifeq ($(strip $(MINGW)),yes)
- 	find $(ARCH_DISTDIR) -type f -name '*.exe' | \
- 	while read file ; do \
- 	    cmd=`basename "$$file" .exe` ; \
-@@ -278,7 +278,7 @@
- 	-cd ${GISBASE} ; tar cBf - driver | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
- 	-cd ${GISBASE} ; tar cBf - etc | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
- 	-cd ${GISBASE} ; tar cBf - fonts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
--ifeq ($(strip $(MINGW)),)
-+ifneq ($(strip $(MINGW)),yes)
- 	-cd ${GISBASE} ; tar cBf - man | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
- endif
- 	-cd ${GISBASE} ; tar cBf - scripts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
-@@ -299,7 +299,7 @@
- 	-sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap > ${INST_DIR}/etc/fontcap
- 	@##### -chmod -R 1777 ${INST_DIR}/locks 2>/dev/null
- 	-chmod -R a+rX ${INST_DIR} 2>/dev/null
--ifeq ($(strip $(MINGW)),)
-+ifneq ($(strip $(MINGW)),yes)
- 	@#GEM installation
- 	-tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null
- 	-${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null
---- grass-6.4.2/lib/python/ctypes/Makefile.orig	2011-05-03 21:27:16.000000000 +0200
-+++ grass-6.4.2/lib/python/ctypes/Makefile	2012-10-20 14:35:23.370275773 +0200
-@@ -57,7 +57,7 @@
- CTYPESFLAGS = --cpp "$(CC) -E $(CPPFLAGS) $(LFS_CFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(DEFS) $(EXTRA_INC) $(INC)"
- EXTRA_CLEAN_FILES := $(foreach M,$(MODULES),$(M).py) $(wildcard ctypesgencore/*.pyc) $(wildcard ctypesgencore/*/*.pyc)
+--- grass-7.0.3/lib/python/ctypes/Makefile.orig	2016-04-03 19:35:16.626262959 +0200
++++ grass-7.0.3/lib/python/ctypes/Makefile	2016-04-03 21:13:18.706016110 +0200
+@@ -58,7 +58,7 @@
+ CTYPESFLAGS = --cpp "$(CC) -E $(CPPFLAGS) $(LFS_CFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(DEFS) $(EXTRA_INC) $(INC) -D__GLIBC_HAVE_LONG_LONG"
+ EXTRA_CLEAN_FILES := $(wildcard ctypesgencore/*.pyc) $(wildcard ctypesgencore/*/*.pyc)
  
 -ifneq ($(MINGW),)
 +ifeq ($(MINGW),yes)
- INTLLIB = -lintl3
- endif
- 
---- grass-6.4.2/visualization/nviz/Makefile.orig	2008-12-23 15:05:57.000000000 +0100
-+++ grass-6.4.2/visualization/nviz/Makefile	2012-10-20 14:36:21.746939990 +0200
-@@ -9,7 +9,7 @@
- PROG=nviz
- INSTALL_DIR=$(GISBASE)/etc/$(NV_VER)
- 
--ifneq ($(strip $(MINGW)),)
-+ifeq ($(strip $(MINGW)),yes)
- 	FIND = find
- else
- 	FIND = find -L
-@@ -36,7 +36,7 @@
- 	-$(MKDIR) $(INSTALL_DIR)
- 	$(INSTALL) src/nvwish$(EXE) $(INSTALL_DIR)/$(PROG)$(EXE)
- 	$(INSTALL) scripts/$(PROG) $(GISBASE)/bin
--ifneq ($(strip $(MINGW)),)
-+ifeq ($(strip $(MINGW)),yes)
- 	$(INSTALL) scripts/nviz.bat $(GISBASE)/bin
- endif
- 	-$(MKDIR) $(INSTALL_DIR)/scripts
---- grass-6.4.2/visualization/nviz/html/Makefile.orig	2008-12-23 15:05:57.000000000 +0100
-+++ grass-6.4.2/visualization/nviz/html/Makefile	2012-10-20 14:36:43.426939080 +0200
-@@ -5,7 +5,7 @@
- 
- GRASS_NVIZ_DOCS=$(GISBASE)/docs/html/nviz
- 
--ifneq ($(strip $(MINGW)),)
-+ifeq ($(strip $(MINGW)),yes)
- 	FIND = find
- else
- 	FIND = find -L
---- grass-6.4.2/gui/tcltk/Makefile.orig	2009-05-11 21:22:34.000000000 +0200
-+++ grass-6.4.2/gui/tcltk/Makefile	2012-10-20 14:39:10.970266222 +0200
-@@ -2,7 +2,7 @@
- 
- SUBDIRS = gis.m
- 
--ifndef MINGW
-+ifneq ($(MINGW),yes)
- SUBDIRS += d.m
+ INTLLIB = -lintl-8
  endif
  
---- grass-6.4.2/gui/scripts/Makefile.orig	2010-01-15 15:41:17.000000000 +0100
-+++ grass-6.4.2/gui/scripts/Makefile	2012-10-20 14:39:41.100264957 +0200
-@@ -2,7 +2,7 @@
+--- grass-7.0.3/gui/scripts/Makefile.orig	2016-04-03 19:35:16.652929624 +0200
++++ grass-7.0.3/gui/scripts/Makefile	2016-04-03 21:15:10.182678097 +0200
+@@ -6,7 +6,7 @@
  
- include $(MODULE_TOPDIR)/include/Make/Dir.make
+ DSTDIR = $(GUIDIR)/scripts
  
 -ifdef MINGW
 +ifeq ($(MINGW),yes)
- SCRIPT_ACTIONS += create.bat
- endif
- 
---- grass-6.4.2/vector/v.transform/Makefile.orig	2008-12-19 21:28:57.000000000 +0100
-+++ grass-6.4.2/vector/v.transform/Makefile	2012-10-20 14:40:59.673594995 +0200
-@@ -5,7 +5,7 @@
- 
- include $(MODULE_TOPDIR)/include/Make/Module.make
- 
--ifdef MINGW
-+ifeq ($(MINGW),yes)
- EXTRA_LIB=
- else
- EXTRA_LIB=$(VASKLIB) $(CURSES)
---- grass-6.4.2/include/Make/Grass.make.in.orig	2011-04-18 20:13:38.000000000 +0200
-+++ grass-6.4.2/include/Make/Grass.make.in	2012-10-20 14:58:30.123550911 +0200
-@@ -86,7 +86,7 @@
+ PYFILES := $(patsubst %.py, $(DSTDIR)/%_wrapper.py, $(filter %.py, $(PY_SOURCES)))
+ BATFILES := $(patsubst %.py, $(DSTDIR)/%.bat, $(filter %.py, $(PY_SOURCES)))
+ $(DSTDIR)/%_wrapper.py: %.py | $(DSTDIR)
+--- grass-7.0.3/include/Make/Grass.make.orig	2014-11-03 10:57:12.000000000 +0100
++++ grass-7.0.3/include/Make/Grass.make	2016-04-03 21:16:54.589340383 +0200
+@@ -80,7 +80,7 @@
  VECT_CFLAGS =  $(GDALCFLAGS) $(GEOSCFLAGS)
  
  # Object with _fmode which must be linked to each executable on Windows
 -ifdef MINGW
 +ifeq ($(MINGW),yes)
-   FMODE_OBJ = $(MODULE_TOPDIR)/lib/gis/$(OBJDIR)/fmode.o
- endif
+ WINDRES = windres
+ FMODE_OBJ = $(BASE_LIBDIR)/fmode.o
+ # if fmode.o causes trouble, try:
+@@ -235,7 +235,7 @@
+ 
+ ifneq ($(GDAL_LINK),)
+ ifneq ($(GDAL_DYNAMIC),)
+-ifneq ($(MINGW),)
++ifeq ($(MINGW),yes)
+ RASTERDEPS += -lkernel32
+ else
+ RASTERDEPS += $(DLLIB)
+@@ -277,7 +277,7 @@
  
---- grass-6.4.2/include/Make/Shlib.make.orig	2012-10-20 14:41:45.603593065 +0200
-+++ grass-6.4.2/include/Make/Shlib.make	2012-10-20 14:59:13.833549075 +0200
-@@ -3,7 +3,7 @@
- SHLIB = $(ARCH_LIBDIR)/$(SHLIB_PREFIX)$(SHLIB_NAME)$(SHLIB_SUFFIX)
+ $(foreach lib,$(libs),$(eval $(call lib_rules,$(firstword $(subst :, ,$(lib))),$(lastword $(subst :, ,$(lib))))))
  
- # Object that calls _setfmode(_O_BINARY) which must be linked to each DLL on Windows
--ifdef MINGW
+-ifneq ($(MINGW),)
 +ifeq ($(MINGW),yes)
- ifneq ($(SHLIB_NAME),$(DATETIME_LIBNAME))
- ifneq ($(SHLIB_NAME),$(GIS_LIBNAME))
-   DLLMAIN_OBJ = $(MODULE_TOPDIR)/lib/gis/$(OBJDIR)/dllmain.o
-@@ -16,7 +16,7 @@
+ GISLIB += $(INTLLIB)
+ endif
+ 
+--- grass-7.0.3/include/Make/Shlib.make.orig	2016-04-03 19:35:16.679596287 +0200
++++ grass-7.0.3/include/Make/Shlib.make	2016-04-03 21:17:48.062671474 +0200
+@@ -8,7 +8,7 @@
  
  $(SHLIB): $(SHLIB_OBJS)
- 	$(SHLIB_LD) -o $@ -Wl,-soname,$(notdir $@) $(LDFLAGS) $^ $(EXTRA_LIBS) $(DLLMAIN_OBJ)
+ 	$(SHLIB_LD) -o $@ -Wl,-soname,$(notdir $@) $(LDFLAGS) $^ $(LIBES) $(EXTRA_LIBS) $(MATHLIB)
 -ifndef MINGW
 +ifneq ($(MINGW),yes)
  	(cd $(ARCH_LIBDIR); ln -f -s $(notdir $@) $(patsubst %.$(GRASS_VERSION_NUMBER)$(SHLIB_SUFFIX),%$(SHLIB_SUFFIX),$@))
  endif
  
---- grass-6.4.2/include/Make/Script.make.orig	2009-07-05 14:48:37.000000000 +0200
-+++ grass-6.4.2/include/Make/Script.make	2012-10-20 14:59:58.503547201 +0200
-@@ -11,7 +11,7 @@
- include $(MODULE_TOPDIR)/include/Make/Rules.make
+--- grass-7.0.3/include/Make/Script.make.orig	2016-04-03 19:35:16.679596287 +0200
++++ grass-7.0.3/include/Make/Script.make	2016-04-03 21:18:54.369335354 +0200
+@@ -1,7 +1,7 @@
+ 
+ include $(MODULE_TOPDIR)/include/Make/Vars.make
  
- SCRIPT_ACTIONS = $(SCRIPT)
+-ifdef MINGW
++ifeq ($(MINGW),yes)
+ SCRIPT = $(SCRIPTDIR)/$(PGM).py
+ else
+ SCRIPT = $(SCRIPTDIR)/$(PGM)
+@@ -18,7 +18,7 @@
+ include $(MODULE_TOPDIR)/include/Make/ScriptRules.make
+ 
+ SCRIPT_ACTIONS = $(SCRIPT) $(ETCPYFILES) $(ETCPYCFILES) html scriptstrings
 -ifdef MINGW
 +ifeq ($(MINGW),yes)
  SCRIPT_ACTIONS += $(BIN)/$(PGM).bat
+ SCRIPT_DIR = %GISBASE%/scripts
  endif
- 
 --- grass-6.4.3/include/Make/Rules.make.orig	2013-03-02 11:52:07.000000000 +0100
 +++ grass-6.4.3/include/Make/Rules.make	2014-06-11 21:22:16.080021691 +0200
 @@ -66,7 +66,7 @@
@@ -195,24 +113,46 @@
  mkpath = $(shell $(TOOLSDIR)/g.echo$(EXE) $(1));$(2)
  else
  mkpath = $(1):$(2)
---- grass-6.4.2/general/g.version/Makefile.orig	2011-04-18 20:13:39.000000000 +0200
-+++ grass-6.4.2/general/g.version/Makefile	2012-10-21 08:48:28.460856763 +0200
-@@ -29,4 +29,4 @@
- 	sed -e 's/^\(.*\)$$/"\1\\n"/' $< > $@
+--- grass-7.0.3/include/Make/GuiScript.make.orig	2014-12-17 14:10:44.000000000 +0100
++++ grass-7.0.3/include/Make/GuiScript.make	2016-04-03 21:20:29.075998049 +0200
+@@ -10,7 +10,7 @@
+ MODULES  := $(patsubst g.gui.%.py,%,$(wildcard g.gui.*.py))
+ CMDHTML  := $(patsubst %,$(HTMLDIR)/g.gui.%.html,$(MODULES))
+ GUIHTML  := $(patsubst %,$(HTMLDIR)/wxGUI.%.html,$(MODULES))
+-ifdef MINGW
++ifeq ($(MINGW),yes)
+ SCRIPTEXT = .py
+ BATFILES  := $(patsubst %,$(BIN)/g.gui.%.bat,$(MODULES))
+ else
+--- grass-7.0.3/lib/proj/Makefile.orig	2015-12-17 09:13:35.000000000 +0100
++++ grass-7.0.3/lib/proj/Makefile	2016-04-03 21:20:54.752663637 +0200
+@@ -36,7 +36,7 @@
+ default: lib $(FTOL_OBJ)
+ 	$(MAKE) $(NAD_DSTFILES) $(CSV_DSTFILES) $(PROJ_DSTFILES) $(NAD_SRCFILES)
  
- $(OBJDIR)/confparms.h: $(MODULE_TOPDIR)/config.status
--	sed -n '7s/^#\(.*\)$$/"\1"/p' $< > $@
-+	sed -n '7s/^#\(.*\)$$/"\1"/p;s/^ac_cs_config="\(.*"\)$$/".\/configure \1/p' $< > $@
---- grass-6.4.4/configure.in~	2015-07-19 06:50:37.000000000 +0000
-+++ grass-6.4.4/configure.in	2015-07-19 06:51:21.133489471 +0000
+-ifdef MINGW
++ifeq ($(MINGW),yes)
+ $(FTOL_OBJ): $(OBJDIR)/ftol.o
+ 	$(INSTALL) $< $@
+ endif
+--- grass-7.0.3/configure.in~	2015-07-19 06:50:37.000000000 +0000
++++ grass-7.0.3/configure.in	2015-07-19 06:51:21.133489471 +0000
 @@ -101,10 +101,6 @@
  
  AC_SUBST(ARCH)
  
 -# Use absolute path for aux directory so that install-sh works
 -
--AC_CONFIG_AUX_DIR($SRCDIR)
+-AC_CONFIG_AUX_DIR("$SRCDIR")
 -
  # Set GISBASE and GRASS_BIN
  
  GISBASE="${WINDSTDIR}/dist.${ARCH}"
+--- grass-7.0.3/include/Makefile.orig	2011-11-14 09:26:04.000000000 +0100
++++ grass-7.0.3/include/Makefile	2016-04-03 17:16:49.983278219 +0200
+@@ -46,4 +46,4 @@
+ 	sed -e 's/^\(.*\)$$/"\1\\n"/' $< > $@
+ 
+ $(ARCH_INCDIR)/confparms.h: $(MODULE_TOPDIR)/config.status | $(ARCH_INCDIR)
+-	sed -n '7s/^#\(.*\)$$/"\1"/p' $< > $@
++	sed -n '7s/^#\(.*\)$$/"\1"/p;s/^ac_cs_config="\(.*"\)$$/".\/configure \1/p' $< > $@
diff --git a/grass-ffmpeg.patch b/grass-ffmpeg.patch
deleted file mode 100644
index 59a2742..0000000
--- a/grass-ffmpeg.patch
+++ /dev/null
@@ -1,126 +0,0 @@
---- grass-6.4.3/lib/ogsf/gsd_img_mpeg.c.orig	2013-07-09 21:05:44.000000000 +0200
-+++ grass-6.4.3/lib/ogsf/gsd_img_mpeg.c	2014-06-10 21:53:30.055116809 +0200
-@@ -31,7 +31,7 @@
- #include <avutil.h>
- #else
- /* libavutil 51.22.1's avutil.h doesn't include libavutil/mathematics.h */
--#include <mathematics.h>
-+#include <libavutil/mathematics.h>
- #endif
- 
- /* 5 seconds stream duration */
-@@ -38,7 +38,7 @@
- #define STREAM_DURATION   5.0
- #define STREAM_FRAME_RATE 25	/* 25 images/s */
- #define STREAM_NB_FRAMES  ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
--#define STREAM_PIX_FMT PIX_FMT_YUV420P	/* default pix_fmt */
-+#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P	/* default pix_fmt */
- 
- AVFrame *picture, *tmp_picture;
- uint8_t *video_outbuf;
-@@ -95,11 +95,11 @@
-     c->time_base.num = 1;
-     c->gop_size = 12;		/* emit one intra frame every twelve frames at most */
-     c->pix_fmt = STREAM_PIX_FMT;
--    if (c->codec_id == CODEC_ID_MPEG2VIDEO) {
-+    if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
- 	/* just for testing, we also add B frames */
- 	c->max_b_frames = 2;
-     }
--    if (c->codec_id == CODEC_ID_MPEG1VIDEO) {
-+    if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
- 	/* Needed to avoid using macroblocks in which some coeffs overflow.
- 	   This does not happen with normal video, it just happens here as
- 	   the motion of the chroma plane does not match the luma plane. */
-@@ -138,7 +138,7 @@
-     uint8_t *picture_buf;
-     int size;
- 
--    picture = avcodec_alloc_frame();
-+    picture = av_frame_alloc();
- 
-     if (!picture)
- 	return NULL;
-@@ -147,7 +147,7 @@
-     picture_buf = av_malloc(size);
- 
-     if (!picture_buf) {
--	av_free(picture);
-+	av_frame_free(&picture);
- 	return NULL;
-     }
- 
-@@ -210,8 +210,8 @@
-        picture is needed too. It is then converted to the required
-        output format */
-     tmp_picture = NULL;
--    if (c->pix_fmt != PIX_FMT_YUV420P) {
--	tmp_picture = alloc_picture(PIX_FMT_YUV420P, c->width, c->height);
-+    if (c->pix_fmt != AV_PIX_FMT_YUV420P) {
-+	tmp_picture = alloc_picture(AV_PIX_FMT_YUV420P, c->width, c->height);
- 	if (!tmp_picture) {
- 	    G_warning(_("Unable to allocate temporary picture"));
- 	    return;
-@@ -250,27 +250,20 @@
- 	ret = av_write_frame(oc, &pkt);
-     }
-     else {
-+	AVPacket pkt;
-+	int got_packet;
-+	av_init_packet(&pkt);
-+	pkt.data = video_outbuf;
-+	pkt.size = video_outbuf_size;
- 	/* encode the image */
--	out_size =
--	    avcodec_encode_video(c, video_outbuf, video_outbuf_size, picture);
-+	ret = avcodec_encode_video2(c, &pkt, picture, &got_packet);
- 	/* if zero size, it means the image was buffered */
--	if (out_size > 0) {
--	    AVPacket pkt;
--
--	    av_init_packet(&pkt);
-+	if ((ret >= 0) && got_packet) {
- 
- 	    pkt.pts =
--		av_rescale_q(c->coded_frame->pts, c->time_base,
-+		av_rescale_q(pkt.pts, c->time_base,
- 			     st->time_base);
--	    if (c->coded_frame->key_frame)
--#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 32, 0)
--		pkt.flags |= PKT_FLAG_KEY;
--#else
--		pkt.flags |= AV_PKT_FLAG_KEY;
--#endif
- 	    pkt.stream_index = st->index;
--	    pkt.data = video_outbuf;
--	    pkt.size = out_size;
- 
- 	    /* write the compressed frame in the media file */
- 	    ret = av_write_frame(oc, &pkt);
-@@ -296,10 +289,10 @@
- {
-     avcodec_close(st->codec);
-     av_free(picture->data[0]);
--    av_free(picture);
-+    av_frame_free(&picture);
-     if (tmp_picture) {
- 	av_free(tmp_picture->data[0]);
--	av_free(tmp_picture);
-+	av_frame_free(&tmp_picture);
-     }
-     av_free(video_outbuf);
- }
-@@ -362,11 +362,11 @@
-     /* if you want to hardcode the codec (eg #ifdef USE_XVID)
-        this may be the place to do it (?????) */
- #ifdef USE_XVID
--    fmt->video_codec = CODEC_ID_XVID;
-+    fmt->video_codec = AV_CODEC_ID_XVID;
- #endif
- 
-     video_st = NULL;
--    if (fmt->video_codec != CODEC_ID_NONE) {
-+    if (fmt->video_codec != AV_CODEC_ID_NONE) {
- 	video_st =
- 	    add_video_stream(oc, fmt->video_codec, (r - l + 1), (t - b + 1));
-     }
diff --git a/grass-format.patch b/grass-format.patch
index ee22909..eb0bd69 100644
--- a/grass-format.patch
+++ b/grass-format.patch
@@ -1,3097 +1,29 @@
-From 76422f2e4f2ee7defabbf866688051307a20d0f7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Ralf=20Cors=C3=A9pius?= <corsepiu at fedoraproject.org>
-Date: Sun, 10 Aug 2014 06:27:58 +0200
-Subject: [PATCH 4/4] Eliminate -Werror=format-string-security issues.
-
----
- db/drivers/dbf/column.c                            |  2 +-
- display/d.colors/main.c                            |  4 +-
- display/d.erase/main.c                             |  2 +-
- display/d.save/main.c                              |  2 +-
- display/d.what.vect/what.c                         |  2 +-
- general/g.mapset/main.c                            |  2 +-
- general/g.setproj/get_stp.c                        |  2 +-
- general/g.setproj/main.c                           |  6 +-
- imagery/i.landsat.toar/landsat_met.c               |  4 +-
- imagery/i.ortho.photo/i.photo.2image/target.c      |  2 +-
- imagery/i.ortho.photo/i.photo.2target/target.c     |  2 +-
- .../i.ortho.photo/i.photo.camera/mod_cam_info.c    |  2 +-
- imagery/i.ortho.photo/i.photo.elev/ask_elev.c      |  4 +-
- imagery/i.ortho.photo/i.photo.elev/main.c          |  2 +-
- imagery/i.ortho.photo/i.photo.rectify/cp.c         |  4 +-
- imagery/i.ortho.photo/i.photo.rectify/target.c     |  2 +-
- imagery/i.ortho.photo/libes/camera.c               |  3 +-
- imagery/i.ortho.photo/libes/conz_points.c          | 18 ++--
- imagery/i.ortho.photo/libes/fopen_camera.c         |  5 +-
- imagery/i.ortho.photo/libes/init_info.c            | 11 +--
- imagery/i.ortho.photo/libes/m_mult.c               |  2 +-
- imagery/i.ortho.photo/libes/open_camera.c          |  5 +-
- imagery/i.ortho.photo/libes/ref_points.c           | 11 +--
- imagery/i.ortho.photo/menu/target.c                |  2 +-
- imagery/i.pca/support.c                            |  3 +-
- imagery/i.points/target.c                          |  2 +-
- imagery/i.rectify/cp.c                             |  2 +-
- imagery/i.rectify/target.c                         |  2 +-
- imagery/i.vpoints/analyze.c                        |  4 +-
- imagery/i.vpoints/target.c                         |  2 +-
- lib/db/dbmi_base/login.c                           |  2 +-
- lib/db/dbmi_client/delete_tab.c                    |  2 +-
- lib/driver/command.c                               |  2 +-
- lib/g3d/g3derror.c                                 |  2 +-
- lib/g3d/g3drange.c                                 |  3 +-
- lib/g3d/g3dwindowio.c                              |  2 +-
- lib/gis/get_cellhd.c                               |  4 +-
- lib/gis/get_datum_name.c                           |  8 +-
- lib/gis/get_ellipse.c                              |  2 +-
- lib/gis/history.c                                  |  3 +-
- lib/gis/null_val.c                                 |  2 +-
- lib/gis/put_cellhd.c                               |  5 +-
- lib/gis/put_title.c                                | 16 ++--
- lib/gis/quant_io.c                                 |  6 +-
- lib/gis/quant_rw.c                                 | 26 ++----
- lib/gis/range.c                                    | 15 ++--
- lib/gis/seek.c                                     |  6 +-
- lib/gmath/la.c                                     | 98 +++++++++++-----------
- lib/proj/datum.c                                   |  4 +-
- lib/proj/get_proj.c                                |  2 +-
- lib/raster/io_sock.c                               | 22 ++---
- lib/sites/sites.c                                  |  2 +-
- lib/symbol/read.c                                  |  2 +-
- lib/vector/Vlib/open.c                             |  4 +-
- raster/r.describe/describe.c                       |  2 +-
- raster/r.external/main.c                           |  2 +-
- raster/r.flow/mem.h                                |  8 +-
- raster/r.in.arc/gethead.c                          |  4 +-
- raster/r.in.ascii/gethead.c                        |  2 +-
- raster/r.in.gdal/main.c                            |  4 +-
- raster/r.in.mat/main.c                             |  6 +-
- raster/r.in.xyz/main.c                             |  2 +-
- raster/r.le/r.le.patch/driver.c                    |  5 +-
- raster/r.out.vrml/main.c                           | 23 ++---
- raster/r.profile/main.c                            |  2 +-
- raster/r.profile/read_rast.c                       |  6 +-
- raster/r.quant/main.c                              | 16 ++--
- raster/r.quant/read_rules.c                        |  7 +-
- raster/r.random.surface/init.c                     |  4 +-
- raster/r.reclass/main.c                            |  2 +-
- raster/r.resamp.rst/main.c                         |  2 +-
- raster/r.rescale.eq/main.c                         |  4 +-
- raster/r.rescale/main.c                            |  4 +-
- raster/r.surf.contour/bseg_get.c                   |  4 +-
- raster/r.surf.contour/bseg_put.c                   |  7 +-
- raster/r.surf.contour/bseg_read.c                  |  7 +-
- raster/r.surf.contour/dseg_read.c                  | 10 +--
- raster/r.surf.contour/dseg_write.c                 |  7 +-
- raster/r.to.rast3/main.c                           |  6 +-
- raster/r.to.rast3elev/main.c                       |  2 +-
- raster/r.to.vect/areas_io.c                        |  2 +-
- raster/r.to.vect/main.c                            |  4 +-
- raster/r.to.vect/util.c                            |  2 +-
- raster/r.volume/main.c                             |  2 +-
- raster/r.water.outlet/legal.c                      |  4 +-
- raster/r.water.outlet/main.c                       |  2 +-
- raster/r.watershed/seg/bseg_read.c                 |  7 +-
- raster/r.watershed/seg/cseg_read.c                 | 10 +--
- raster/r.watershed/seg/dseg_read.c                 | 10 +--
- raster/r.what/die.c                                |  2 +-
- raster/wildfire/r.spread/collect_ori.c             |  4 +-
- raster3d/r3.cross.rast/main.c                      |  2 +-
- raster3d/r3.in.ascii/main.c                        |  2 +-
- raster3d/r3.in.v5d/main.c                          |  2 +-
- raster3d/r3.out.ascii/main.c                       |  2 +-
- raster3d/r3.out.v5d/main.c                         |  2 +-
- raster3d/r3.to.rast/main.c                         |  2 +-
- vector/v.convert/att.c                             |  4 +-
- vector/v.in.ascii/in.c                             |  2 +-
- vector/v.in.ascii/points.c                         |  2 +-
- vector/v.in.dwg/entity.c                           |  2 +-
- vector/v.in.dwg/main.c                             |  4 +-
- vector/v.in.ogr/main.c                             |  6 +-
- vector/v.in.sites/main.c                           |  4 +-
- vector/v.net.allpairs/main.c                       |  4 +-
- vector/v.net.centrality/main.c                     |  2 +-
- vector/v.net.components/main.c                     |  4 +-
- vector/v.net.distance/main.c                       |  4 +-
- vector/v.net.flow/main.c                           |  4 +-
- vector/v.net.path/path.c                           |  4 +-
- vector/v.net.timetable/main.c                      |  6 +-
- vector/v.overlay/area_area.c                       |  2 +-
- vector/v.overlay/line_area.c                       |  2 +-
- vector/v.overlay/main.c                            |  2 +-
- vector/v.random/main.c                             |  4 +-
- vector/v.surf.rst/main.c                           |  4 +-
- vector/v.vol.rst/main.c                            |  2 +-
- vector/v.vol.rst/user4.c                           |  2 +-
- vector/v.vol.rst/vector.c                          |  2 +-
- vector/v.what.rast/main.c                          |  4 +-
- 120 files changed, 269 insertions(+), 372 deletions(-)
-
-diff --git a/db/drivers/dbf/column.c b/db/drivers/dbf/column.c
-index c953ee0..2cbe857 100644
---- a/db/drivers/dbf/column.c
-+++ b/db/drivers/dbf/column.c
-@@ -39,7 +39,7 @@ int add_column(int tab, int type, char *name, int width, int decimals)
- 	sprintf(buf, "DBMI-DBF driver: column name '%s'", name);
- 	name[DBF_COL_NAME - 1] = '\0';
- 	sprintf(buf + strlen(buf), " truncated to '%s'", name);
--	G_warning(buf);
-+	G_warning("%s", buf);
-     }
- 
-     /* Check if the column exists */
-diff --git a/display/d.colors/main.c b/display/d.colors/main.c
-index 17c6a6d..413ddb1 100644
---- a/display/d.colors/main.c
-+++ b/display/d.colors/main.c
-@@ -75,14 +75,14 @@ int main(int argc, char **argv)
- 	char msg[256];
- 
- 	sprintf(msg, "Raster file [%s] not available", map->answer);
--	G_fatal_error(msg);
-+	G_fatal_error("%s", msg);
-     }
- 
-     if (G_raster_map_is_fp(map->answer, mapset)) {
- 	sprintf(buff,
- 		"Raster file [%s] is floating point! \nd.colors only works with integer maps",
- 		map->answer);
--	G_fatal_error(buff);
-+	G_fatal_error("%s", buff);
-     }
- 
-     /* connect to the driver */
-diff --git a/display/d.erase/main.c b/display/d.erase/main.c
-index dc7c72d..5662b4a 100644
---- a/display/d.erase/main.c
-+++ b/display/d.erase/main.c
-@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
- 
-     R_close_driver();
-     if (err)
--	G_fatal_error(err);
-+	G_fatal_error("%s", err);
- 
-     exit(0);
- }
-diff --git a/display/d.save/main.c b/display/d.save/main.c
-index 6a2e8e0..7f60ca9 100644
---- a/display/d.save/main.c
-+++ b/display/d.save/main.c
-@@ -454,7 +454,7 @@ int set_item(char *item, char **list)
- 	    G_scan_northing(Nstr, &(Mwind->north), proj);
- 	    G_scan_northing(Sstr, &(Mwind->south), proj);
- 	    if ((err = G_adjust_Cell_head(Mwind, 1, 1))) {
--		G_fatal_error(err);
-+		G_fatal_error("%s", err);
- 	    }
- 	    G_format_resolution(Mwind->ew_res, EWRESstr, proj);
- 	    G_format_resolution(Mwind->ns_res, NSRESstr, proj);
-diff --git a/display/d.what.vect/what.c b/display/d.what.vect/what.c
-index 0b5af4d..5c43fb8 100644
---- a/display/d.what.vect/what.c
-+++ b/display/d.what.vect/what.c
-@@ -494,7 +494,7 @@ int what(int once, int txt, int terse, int flash, int width, int mwidth,
- 	    fflush(stdout);
- 	    if (!txt && !topo) {
- 		db_append_string(&html, "</BODY></HTML>");
--		G_debug(3, db_get_string(&html));
-+		G_debug(3, "%s", db_get_string(&html));
- 		F_open(title, db_get_string(&html));
- 	    }
- 
-diff --git a/general/g.mapset/main.c b/general/g.mapset/main.c
-index 2fe0f49..f04e742 100644
---- a/general/g.mapset/main.c
-+++ b/general/g.mapset/main.c
-@@ -167,7 +167,7 @@ int main(int argc, char *argv[])
-     G_asprintf(&lock_prog, "%s/etc/lock", G_gisbase());
- 
-     sprintf(path, "%s/.gislock", mapset_new_path);
--    G_debug(2, path);
-+    G_debug(2, "%s", path);
- 
-     ret = G_spawn(lock_prog, lock_prog, path, gis_lock, NULL);
-     G_debug(2, "lock result = %d", ret);
-diff --git a/general/g.setproj/get_stp.c b/general/g.setproj/get_stp.c
-index 53d4541..dd3170f 100644
---- a/general/g.setproj/get_stp.c
-+++ b/general/g.setproj/get_stp.c
-@@ -56,7 +56,7 @@ int get_stp_code(int code, char *string, char *paramfile)
-     fp = fopen(nad27, "r");
-     if (fp == NULL) {
- 	sprintf(buff, "Can not open NAD27 file %s", nad27);
--	G_fatal_error(buff);
-+	G_fatal_error("%s", buff);
-     }
-     while (!gotit) {
- 	if (fgets(buff, 200, fp) == NULL)
-diff --git a/general/g.setproj/main.c b/general/g.setproj/main.c
-index 4dd5e69..c522f75 100644
---- a/general/g.setproj/main.c
-+++ b/general/g.setproj/main.c
-@@ -250,9 +250,9 @@ int main(int argc, char *argv[])
- 		     0))
- 		    sph_check = ask_datum(datum, dat_ellps, dat_params);
- 		else {
--		    sprintf(datum, lbuf);
--		    sprintf(dat_params, lbufa);
--		    sprintf(dat_ellps, G_datum_ellipsoid(i));
-+		    sprintf(datum, "%s", lbuf);
-+		    sprintf(dat_params, "%s", lbufa);
-+		    sprintf(dat_ellps, "%s", G_datum_ellipsoid(i));
- 		    sph_check = 1;
- 		    G_message(_("The datum information has not been changed"));
- 		}
-diff --git a/imagery/i.landsat.toar/landsat_met.c b/imagery/i.landsat.toar/landsat_met.c
-index 506d719..e6cf055 100644
---- a/imagery/i.landsat.toar/landsat_met.c
-+++ b/imagery/i.landsat.toar/landsat_met.c
-@@ -384,14 +384,14 @@ void lsat_metadata(char *metafile, lsat_data * lsat)
- 	    sprintf(key, "Band%dGainSetting", lsat->band[i].code);
- 	    get_mtldata(mtldata, key, value);
- 	    if (value[0] == '\0') {
--		G_warning(key);
-+		G_warning("%s", key);
- 		continue;
- 	    }
- 	    lsat->band[i].gain = atof(value);
- 	    sprintf(key, "Band%dBiasSetting", lsat->band[i].code);
- 	    get_mtldata(mtldata, key, value);
- 	    if (value[0] == '\0') {
--		G_warning(key);
-+		G_warning("%s", key);
- 		continue;
- 	    }
- 	    lsat->band[i].bias = atof(value);
-diff --git a/imagery/i.ortho.photo/i.photo.2image/target.c b/imagery/i.ortho.photo/i.photo.2image/target.c
-index a5774b2..e4c57d1 100644
---- a/imagery/i.ortho.photo/i.photo.2image/target.c
-+++ b/imagery/i.ortho.photo/i.photo.2image/target.c
-@@ -46,7 +46,7 @@ int get_target(void)
-   error:
-     strcat(buf, "Please run i.target for group ");
-     strcat(buf, group.name);
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
- 
-     return -1;
- }
-diff --git a/imagery/i.ortho.photo/i.photo.2target/target.c b/imagery/i.ortho.photo/i.photo.2target/target.c
-index 85c4008..df4533e 100644
---- a/imagery/i.ortho.photo/i.photo.2target/target.c
-+++ b/imagery/i.ortho.photo/i.photo.2target/target.c
-@@ -81,7 +81,7 @@ G_sleep (3);
-     strcat (buf, "Please run i.target for block ");
-     strcat (buf, block.name);
- ****/
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
- }
- 
- int select_current_env(void)
-diff --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
-index fe737d9..c2e0605 100644
---- a/imagery/i.ortho.photo/i.photo.camera/mod_cam_info.c
-+++ b/imagery/i.ortho.photo/i.photo.camera/mod_cam_info.c
-@@ -81,7 +81,7 @@ int mod_cam_info(int have_old, struct Ortho_Camera_File_Ref *cam_info)
- 	    strcpy(next, "end");
- 	else
- 	    sprintf(next, "%d", endfid);
--	sprintf(next_line, next);
-+	sprintf(next_line, "%s", next);
- 	V_line(line, "                            Next:");
- 	V_ques(next, 's', line, 34, 5);
- 	V_line(line + 2,
-diff --git a/imagery/i.ortho.photo/i.photo.elev/ask_elev.c b/imagery/i.ortho.photo/i.photo.elev/ask_elev.c
-index d27e39e..51e11a4 100644
---- a/imagery/i.ortho.photo/i.photo.elev/ask_elev.c
-+++ b/imagery/i.ortho.photo/i.photo.elev/ask_elev.c
-@@ -8,7 +8,6 @@
- 
- int ask_elev(char *group, char *location, char *mapset)
- {
--    char buf[100];
-     char t1[80];
-     char t2[80];
- 
-@@ -35,10 +34,9 @@ int ask_elev(char *group, char *location, char *mapset)
- 	}
- 
- 	else if ((mapset_elev = G_find_cell(elev_layer, "")) == NULL) {
--	    sprintf(buf,
-+	    G_warning(
- 		    "\n\nraster-file %s not found - select another file\n",
- 		    elev_layer);
--	    G_warning(buf);
- 	    *elev_layer = 0;
- 	    continue;
- 	}
-diff --git a/imagery/i.ortho.photo/i.photo.elev/main.c b/imagery/i.ortho.photo/i.photo.elev/main.c
-index 023ad6c..5e64ebe 100644
---- a/imagery/i.ortho.photo/i.photo.elev/main.c
-+++ b/imagery/i.ortho.photo/i.photo.elev/main.c
-@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
-     strcat(buf, _("Please select a target for group"));
-     strcat(buf, group);
-     G_suppress_warnings(0);
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
- }
- 
- 
-diff --git a/imagery/i.ortho.photo/i.photo.rectify/cp.c b/imagery/i.ortho.photo/i.photo.rectify/cp.c
-index b8ec48c..86e5b33 100644
---- a/imagery/i.ortho.photo/i.photo.rectify/cp.c
-+++ b/imagery/i.ortho.photo/i.photo.rectify/cp.c
-@@ -31,7 +31,7 @@ int get_conz_points(void)
-     default:
- 	return 1;
-     }
--    G_fatal_error(msg);
-+    G_fatal_error("%s", msg);
- }
- 
- int get_ref_points(void)
-@@ -61,6 +61,6 @@ int get_ref_points(void)
-     default:
- 	return 1;
-     }
--    G_fatal_error(msg);
-+    G_fatal_error("%s", msg);
-     /* exit(1);   shouldn't get here */
- }
-diff --git a/imagery/i.ortho.photo/i.photo.rectify/target.c b/imagery/i.ortho.photo/i.photo.rectify/target.c
-index 3adf05b..74b8a80 100644
---- a/imagery/i.ortho.photo/i.photo.rectify/target.c
-+++ b/imagery/i.ortho.photo/i.photo.rectify/target.c
-@@ -31,5 +31,5 @@ int get_target(char *group)
-     sprintf(buf, _("Mapset <%s> in target location <%s> - "), mapset, location);
-     strcat(buf, stat == 0 ? _("permission denied") : _("not found"));
-   error:
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
- }
-diff --git a/imagery/i.ortho.photo/libes/camera.c b/imagery/i.ortho.photo/libes/camera.c
-index 26e454e..fdf7c99 100644
---- a/imagery/i.ortho.photo/libes/camera.c
-+++ b/imagery/i.ortho.photo/libes/camera.c
-@@ -33,10 +33,9 @@ int I_get_group_camera(char *group, char *camera)
-     fd = I_fopen_group_camera_old(group);
-     G_suppress_warnings(0);
-     if (!fd) {
--	sprintf(buf,
-+	G_warning(
- 		_("Unable to open camera file for group <%s> in mapset <%s>"),
- 		group, G_mapset());
--	G_warning(buf);
- 	return 0;
-     }
-     G_getl2(buf, sizeof(buf), fd);
-diff --git a/imagery/i.ortho.photo/libes/conz_points.c b/imagery/i.ortho.photo/libes/conz_points.c
-index cdadb6e..635d4cb 100644
---- a/imagery/i.ortho.photo/libes/conz_points.c
-+++ b/imagery/i.ortho.photo/libes/conz_points.c
-@@ -96,15 +96,13 @@ int I_write_con_points(FILE * fd, struct Ortho_Control_Points *cp)
- int I_get_con_points(char *group, struct Ortho_Control_Points *cp)
- {
-     FILE *fd;
--    char msg[100];
-     int stat;
- 
-     fd = I_fopen_group_file_old(group, POINT_FILE);
-     if (fd == NULL) {
--	sprintf(msg,
-+	G_warning(
- 		"unable to open control point (Z) file for group [%s in %s]",
- 		group, G_mapset());
--	G_warning(msg);
- 	G_sleep(4);
- 	return 0;
-     }
-@@ -112,9 +110,8 @@ int I_get_con_points(char *group, struct Ortho_Control_Points *cp)
-     stat = I_read_con_points(fd, cp);
-     fclose(fd);
-     if (stat < 0) {
--	sprintf(msg, "bad format in control point file for group [%s in %s]",
-+	G_warning("bad format in control point file for group [%s in %s]",
- 		group, G_mapset());
--	G_warning(msg);
- 	G_sleep(4);
- 	return 0;
-     }
-@@ -124,14 +121,12 @@ int I_get_con_points(char *group, struct Ortho_Control_Points *cp)
- int I_put_con_points(char *group, struct Ortho_Control_Points *cp)
- {
-     FILE *fd;
--    char msg[100];
- 
-     fd = I_fopen_group_file_new(group, POINT_FILE);
-     if (fd == NULL) {
--	sprintf(msg,
-+	G_warning(
- 		"unable to create control point file for group [%s in %s]",
- 		group, G_mapset());
--	G_warning(msg);
- 	G_sleep(4);
- 	return 0;
-     }
-@@ -146,17 +141,15 @@ int I_convert_con_points(char *group, struct Ortho_Control_Points *con_cp,
- 			 double N12[3])
- {
-     FILE *fd;
--    char msg[100];
-     int i, stat, status;
-     double e1, e2, n1, n2, z1, z2, e0, n0;
- 
- 
-     fd = I_fopen_group_file_old(group, POINT_FILE);
-     if (fd == NULL) {
--	sprintf(msg,
-+	G_warning(
- 		"unable to open control point (Z) file for group [%s in %s]",
- 		group, G_mapset());
--	G_warning(msg);
- 	G_sleep(4);
- 	return 0;
-     }
-@@ -164,9 +157,8 @@ int I_convert_con_points(char *group, struct Ortho_Control_Points *con_cp,
-     stat = I_read_con_points(fd, con_cp);
-     fclose(fd);
-     if (stat < 0) {
--	sprintf(msg, "bad format in control point file for group [%s in %s]",
-+	G_warning("bad format in control point file for group [%s in %s]",
- 		group, G_mapset());
--	G_warning(msg);
- 	G_sleep(4);
- 	return 0;
-     }
-diff --git a/imagery/i.ortho.photo/libes/fopen_camera.c b/imagery/i.ortho.photo/libes/fopen_camera.c
-index d798e25..7b2c347 100644
---- a/imagery/i.ortho.photo/libes/fopen_camera.c
-+++ b/imagery/i.ortho.photo/libes/fopen_camera.c
-@@ -54,11 +54,8 @@ FILE *I_fopen_cam_file_old(char *camera)
- 
- static int error(char *camera, char *msga, char *msgb)
- {
--    char buf[100];
--
--    sprintf(buf, "%s camera file [%s] in [%s %s] %s",
-+    G_warning("%s camera file [%s] in [%s %s] %s",
- 	    msga, camera, G_location(), G_mapset(), msgb);
--    G_warning(buf);
- 
-     return 0;
- }
-diff --git a/imagery/i.ortho.photo/libes/init_info.c b/imagery/i.ortho.photo/libes/init_info.c
-index 0bb1a67..ab0d6d6 100644
---- a/imagery/i.ortho.photo/libes/init_info.c
-+++ b/imagery/i.ortho.photo/libes/init_info.c
-@@ -94,23 +94,20 @@ int I_write_init_info(FILE * fd, struct Ortho_Camera_Exp_Init *init_info)
- int I_get_init_info(char *group, struct Ortho_Camera_Exp_Init *init_info)
- {
-     FILE *fd;
--    char msg[100];
-     int stat;
- 
-     fd = I_fopen_group_init_old(group);
-     if (fd == NULL) {
--	sprintf(msg, "unable to open camera initial file %s in %s",
-+	G_warning("unable to open camera initial file %s in %s",
- 		group, G_mapset());
--	G_warning(msg);
- 	return 0;
-     }
- 
-     stat = I_read_init_info(fd, init_info);
-     fclose(fd);
-     if (stat < 0) {
--	sprintf(msg, "bad format in camera initial file %s in %s",
-+	G_warning("bad format in camera initial file %s in %s",
- 		group, G_mapset());
--	G_warning(msg);
- 	return 0;
-     }
-     return 1;
-@@ -119,13 +116,11 @@ int I_get_init_info(char *group, struct Ortho_Camera_Exp_Init *init_info)
- int I_put_init_info(char *group, struct Ortho_Camera_Exp_Init *init_info)
- {
-     FILE *fd;
--    char msg[100];
- 
-     fd = I_fopen_group_init_new(group);
-     if (fd == NULL) {
--	sprintf(msg, "unable to open camera initial file %s in %s",
-+	G_warning("unable to open camera initial file %s in %s",
- 		group, G_mapset());
--	G_warning(msg);
- 	return 0;
-     }
- 
-diff --git a/imagery/i.ortho.photo/libes/m_mult.c b/imagery/i.ortho.photo/libes/m_mult.c
-index 301ebc0..b93a512 100644
---- a/imagery/i.ortho.photo/libes/m_mult.c
-+++ b/imagery/i.ortho.photo/libes/m_mult.c
-@@ -21,7 +21,7 @@ int m_mult(MATRIX * a, MATRIX * b, MATRIX * c)
-     if (a->ncols != b->nrows) {
- 	sprintf(message, "*: matrices not conformable, %d x %d * %d x %d\n",
- 		a->nrows, a->ncols, b->nrows, b->ncols);
--	fprintf(stderr, message);
-+	fprintf(stderr, "%s", message);
- 	return error(message);
-     }
- 
-diff --git a/imagery/i.ortho.photo/libes/open_camera.c b/imagery/i.ortho.photo/libes/open_camera.c
-index 30c6184..6b79136 100644
---- a/imagery/i.ortho.photo/libes/open_camera.c
-+++ b/imagery/i.ortho.photo/libes/open_camera.c
-@@ -46,11 +46,8 @@ int I_open_cam_file_old(char *camera, char *file)
- 
- static int camera_error(char *camera, char *file, char *msga, char *msgb)
- {
--    char buf[100];
--
--    sprintf(buf, "%sfile [%s] of group [%s in %s]%s",
-+    G_warning("%sfile [%s] of group [%s in %s]%s",
- 	    msga, file, camera, G_mapset(), msgb);
--    G_warning(buf);
- 
-     return 0;
- }
-diff --git a/imagery/i.ortho.photo/libes/ref_points.c b/imagery/i.ortho.photo/libes/ref_points.c
-index 6f03e8d..2cc726e 100644
---- a/imagery/i.ortho.photo/libes/ref_points.c
-+++ b/imagery/i.ortho.photo/libes/ref_points.c
-@@ -88,16 +88,14 @@ int I_write_ref_points(FILE * fd, struct Ortho_Photo_Points *cp)
- int I_get_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
- {
-     FILE *fd;
--    char msg[100];
-     int stat;
- 
-     /*fprintf (stderr, "Try to f_open_group_file_old \n"); */
-     fd = I_fopen_group_file_old(groupname, REF_POINT_FILE);
-     if (fd == NULL) {
--	sprintf(msg,
-+	G_warning(
- 		"unable to open reference point file for group [%s in %s]",
- 		groupname, G_mapset());
--	G_warning(msg);
- 	return 0;
-     }
- 
-@@ -105,10 +103,9 @@ int I_get_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
-     stat = I_read_ref_points(fd, cp);
-     fclose(fd);
-     if (stat < 0) {
--	sprintf(msg,
-+	G_warning(
- 		"bad format in reference point file for group [%s in %s]",
- 		groupname, G_mapset());
--	G_warning(msg);
- 	return 0;
-     }
-     return 1;
-@@ -117,14 +114,12 @@ int I_get_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
- int I_put_ref_points(char *groupname, struct Ortho_Photo_Points *cp)
- {
-     FILE *fd;
--    char msg[100];
- 
-     fd = I_fopen_group_file_new(groupname, REF_POINT_FILE);
-     if (fd == NULL) {
--	sprintf(msg,
-+	G_warning(
- 		"unable to create reference point file for group [%s in %s]",
- 		groupname, G_mapset());
--	G_warning(msg);
- 	return 0;
-     }
- 
-diff --git a/imagery/i.ortho.photo/menu/target.c b/imagery/i.ortho.photo/menu/target.c
-index 60843f2..d590eda 100644
---- a/imagery/i.ortho.photo/menu/target.c
-+++ b/imagery/i.ortho.photo/menu/target.c
-@@ -34,5 +34,5 @@ int get_target(char *name, struct Cell_head *target_window)
-     sprintf(buf, "Mapset [%s] in target location [%s] - ", mapset, location);
-     strcat(buf, stat == 0 ? "permission denied\n" : "not found\n");
-   error:
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
- }
-diff --git a/imagery/i.pca/support.c b/imagery/i.pca/support.c
-index 3e83818..67bf600 100644
---- a/imagery/i.pca/support.c
-+++ b/imagery/i.pca/support.c
-@@ -63,7 +63,8 @@ static void write_history(int bands, char *outname, double **eigmat, double *eig
- 	sprintf(tmpa, "[%5.2f%%]", eigval[i] * 100/eigval_total);
- 	strcat(tmpeigen, tmpa);
- 
--	sprintf(hist.edhist[i + 1], tmpeigen);
-+//	sprintf(hist.edhist[i + 1], tmpeigen);
-+        strcpy(hist.edhist[i + 1], tmpeigen);
- 
- 	/* write eigen values to stdout */
- 	if (first_map)
-diff --git a/imagery/i.points/target.c b/imagery/i.points/target.c
-index da22d8a..92b65d5 100644
---- a/imagery/i.points/target.c
-+++ b/imagery/i.points/target.c
-@@ -40,7 +40,7 @@ int get_target(void)
-   error:
-     strcat(buf, "Please run i.target for group ");
-     strcat(buf, group.name);
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
- }
- 
- int select_current_env(void)
-diff --git a/imagery/i.rectify/cp.c b/imagery/i.rectify/cp.c
-index 0a3e4fa..aca5b44 100644
---- a/imagery/i.rectify/cp.c
-+++ b/imagery/i.rectify/cp.c
-@@ -40,7 +40,7 @@ int get_control_points(char *group, int order	/* THIS HAS BEEN ADDED WITH THE CR
- 	 */
- 	return 1;
-     }
--    G_fatal_error(msg);
-+    G_fatal_error("%s", msg);
- 
-     return 0; /* G_fatal_error() calls exit() */
- }
-diff --git a/imagery/i.rectify/target.c b/imagery/i.rectify/target.c
-index 868db6a..aa4d947 100644
---- a/imagery/i.rectify/target.c
-+++ b/imagery/i.rectify/target.c
-@@ -34,6 +34,6 @@ int get_target(char *group)
-   error:
-     strcat(buf, _("Please run i.target for group."));
-     strcat(buf, group);
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
-     return 1;			/* never reached */
- }
-diff --git a/imagery/i.vpoints/analyze.c b/imagery/i.vpoints/analyze.c
-index f19a3f4..008dc9e 100644
---- a/imagery/i.vpoints/analyze.c
-+++ b/imagery/i.vpoints/analyze.c
-@@ -116,11 +116,9 @@ static int delete_mark(void)
- int delete_control_point(int n)
- {
-     int i;
--    char msg[80];
- 
-     if ((n < 0) | (n > group.points.count - 1)) {
--	sprintf(msg, "%d is an invalid control point index value.", n);
--	G_warning(msg);
-+	G_warning("%d is an invalid control point index value.", n);
- 	return 1;
-     }
-     for (i = n; i < group.points.count - 1; i++) {
-diff --git a/imagery/i.vpoints/target.c b/imagery/i.vpoints/target.c
-index c245b02..7408592 100644
---- a/imagery/i.vpoints/target.c
-+++ b/imagery/i.vpoints/target.c
-@@ -41,7 +41,7 @@ int get_target(void)
-   error:
-     strcat(buf, "Please run i.target for group ");
-     strcat(buf, group.name);
--    G_fatal_error(buf);
-+    G_fatal_error("%s", buf);
- 
-     return -1;
- }
-diff --git a/lib/db/dbmi_base/login.c b/lib/db/dbmi_base/login.c
-index 41b625d..462fb77 100644
---- a/lib/db/dbmi_base/login.c
-+++ b/lib/db/dbmi_base/login.c
-@@ -95,7 +95,7 @@ int read_file(LOGIN * login)
- 		ret, dr, db, usr, pwd);
- 
- 	if (ret < 2) {
--	    G_warning(_("Login file corrupted"));
-+	    G_warning("%s", _("Login file corrupted"));
- 	    continue;
- 	}
- 
-diff --git a/lib/db/dbmi_client/delete_tab.c b/lib/db/dbmi_client/delete_tab.c
-index 98c4ab0..cf053c2 100644
---- a/lib/db/dbmi_client/delete_tab.c
-+++ b/lib/db/dbmi_client/delete_tab.c
-@@ -47,7 +47,7 @@ int db_delete_table(const char *drvname, const char *dbname, const char *tblname
-     db_init_string(&sql);
-     db_set_string(&sql, "drop table ");
-     db_append_string(&sql, tblname);
--    G_debug(3, db_get_string(&sql));
-+    G_debug(3, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	G_warning(_("Unable to drop table: '%s'"),
-diff --git a/lib/driver/command.c b/lib/driver/command.c
-index 479037d..cc8fb44 100644
---- a/lib/driver/command.c
-+++ b/lib/driver/command.c
-@@ -544,7 +544,7 @@ int get_command(char *c)
- 	    continue;
- 	while (*c == COMMAND_ESC)
- 	    if (read1(c) != 0) {
--		G_warning(_("Monitor: get_command: Premature EOF"));
-+		G_warning("%s", _("Monitor: get_command: Premature EOF"));
- 		return 1;	/* EOF */
- 	    }
- 	if (*c)
-diff --git a/lib/g3d/g3derror.c b/lib/g3d/g3derror.c
-index 4c3533f..ea07904 100644
---- a/lib/g3d/g3derror.c
-+++ b/lib/g3d/g3derror.c
-@@ -40,7 +40,7 @@ void G3d_skipError(const char *msg)
- void G3d_printError(const char *msg)
- {
-     fprintf(stderr, "ERROR: ");
--    fprintf(stderr, msg);
-+    fprintf(stderr, "%s", msg);
-     fprintf(stderr, "\n");
- }
- 
-diff --git a/lib/g3d/g3drange.c b/lib/g3d/g3drange.c
-index ce0b06b..ede6027 100644
---- a/lib/g3d/g3drange.c
-+++ b/lib/g3d/g3drange.c
-@@ -196,8 +196,7 @@ static int writeRange(const char *name, struct FPRange *range)
- 
-   error:
-     G_remove(buf, buf2);	/* remove the old file with this name */
--    sprintf(buf, "can't write range file for [%s in %s]", name, G_mapset());
--    G_warning(buf);
-+    G_warning("can't write range file for [%s in %s]", name, G_mapset());
-     return -1;
- }
- 
-diff --git a/lib/g3d/g3dwindowio.c b/lib/g3d/g3dwindowio.c
-index a1aaa76..1a1cd4c 100644
---- a/lib/g3d/g3dwindowio.c
-+++ b/lib/g3d/g3dwindowio.c
-@@ -71,7 +71,7 @@ static void G3d_getFullWindowPath(char *path, const char *windowName)
- 	windowName++;
- 
-     if (strchr(windowName, GRASS_DIRSEP) || strchr(windowName, HOST_DIRSEP)) {
--	sprintf(path, windowName);
-+	sprintf(path, "%s", windowName);
- 	return;
-     }
- 
-diff --git a/lib/gis/get_cellhd.c b/lib/gis/get_cellhd.c
-index f015a0f..18197d5 100644
---- a/lib/gis/get_cellhd.c
-+++ b/lib/gis/get_cellhd.c
-@@ -78,7 +78,7 @@ int G_get_cellhd(const char *name, const char *mapset,
- 		sprintf(tail, _("which is missing."));
- 	    else
- 		sprintf(tail, _("whose header file can't be opened."));
--	    G_warning(buf);
-+	    G_warning("%s", buf);
- 	    return -1;
- 	}
-     }
-@@ -112,6 +112,6 @@ int G_get_cellhd(const char *name, const char *mapset,
- 
-     G_free(err);
- 
--    G_warning(buf);
-+    G_warning("%s", buf);
-     return -1;
- }
-diff --git a/lib/gis/get_datum_name.c b/lib/gis/get_datum_name.c
-index c0d0f48..dde8e05 100644
---- a/lib/gis/get_datum_name.c
-+++ b/lib/gis/get_datum_name.c
-@@ -106,15 +106,15 @@ int G_ask_datum_name(char *datumname, char *ellpsname)
- 	/* For a custom datum we need to interactively ask for the ellipsoid */
- 	if (G_ask_ellipse_name(ellipse) < 0)
- 	    return -1;
--	sprintf(ellpsname, ellipse);
--	sprintf(datumname, "custom");
-+	strcpy(ellpsname, ellipse);
-+	strcpy(datumname, "custom");
-     }
-     else {
- 	/* else can look it up from datum.table */
- 	if ((i = G_get_datum_by_name(answer)) < 0)
- 	    return -1;
--	sprintf(ellpsname, G_datum_ellipsoid(i));
--	sprintf(datumname, G_datum_name(i));
-+	strcpy(ellpsname, G_datum_ellipsoid(i));
-+	strcpy(datumname, G_datum_name(i));
-     }
- 
-     return 1;
-diff --git a/lib/gis/get_ellipse.c b/lib/gis/get_ellipse.c
-index 04b4dfe..1877aac 100644
---- a/lib/gis/get_ellipse.c
-+++ b/lib/gis/get_ellipse.c
-@@ -281,7 +281,7 @@ static int read_ellipsoid_table(int fatal)
-     if (fd == NULL) {
- 	perror(file);
- 	sprintf(buf, _("Unable to open ellipsoid table file <%s>"), file);
--	fatal ? G_fatal_error(buf) : G_warning(buf);
-+	fatal ? G_fatal_error("%s", buf) : G_warning("%s", buf);
- 	return 0;
-     }
- 
-diff --git a/lib/gis/history.c b/lib/gis/history.c
-index 9e25039..4b52b71 100644
---- a/lib/gis/history.c
-+++ b/lib/gis/history.c
-@@ -270,7 +270,8 @@ int G_command_history(struct History *hist)
-     }
- 
-     if (cmdlen < 70) {		/* ie if it will fit on a single line */
--	sprintf(hist->edhist[hist->edlinecnt], G_recreate_command());
-+//	sprintf(hist->edhist[hist->edlinecnt], G_recreate_command());
-+        strcpy(hist->edhist[hist->edlinecnt], G_recreate_command());
- 	hist->edlinecnt++;
-     }
-     else {			/* multi-line required */
-diff --git a/lib/gis/null_val.c b/lib/gis/null_val.c
-index 1f1d59f..ac92aaf 100644
---- a/lib/gis/null_val.c
-+++ b/lib/gis/null_val.c
-@@ -112,7 +112,7 @@ static void InitError(void)
-     strcpy(errMsg, _("Null values have not been initialized. "));
-     strcat(errMsg, _("G_gisinit() must be called first. "));
-     strcat(errMsg, _("Please advise GRASS developers of this error.\n"));
--    G_fatal_error(errMsg);
-+    G_fatal_error("%s", errMsg);
- 
-     return;
- }
-diff --git a/lib/gis/put_cellhd.c b/lib/gis/put_cellhd.c
-index 1500ce3..747dfa0 100644
---- a/lib/gis/put_cellhd.c
-+++ b/lib/gis/put_cellhd.c
-@@ -21,10 +21,7 @@ int G_put_cellhd(const char *name, struct Cell_head *cellhd)
-     FILE *fd;
- 
-     if (!(fd = G_fopen_new("cellhd", name))) {
--	char buf[1024];
--
--	sprintf(buf, _("Unable to create header file for [%s]"), name);
--	G_warning(buf);
-+	G_warning(_("Unable to create header file for [%s]"), name);
- 	return -1;
-     }
- 
-diff --git a/lib/gis/put_title.c b/lib/gis/put_title.c
-index 36dab0a..41ff3ef 100644
---- a/lib/gis/put_title.c
-+++ b/lib/gis/put_title.c
-@@ -25,10 +25,8 @@ int G_put_cell_title(const char *name, const char *title)
-     in = out = 0;
-     in = G_fopen_old("cats", name, mapset);
-     if (!in) {
--	sprintf(buf,
--		_("category information for [%s] in [%s] missing or invalid"),
-+	G_warning(_("category information for [%s] in [%s] missing or invalid"),
- 		name, mapset);
--	G_warning(buf);
- 	return -1;
-     }
- 
-@@ -36,8 +34,7 @@ int G_put_cell_title(const char *name, const char *title)
-     out = fopen(tempfile, "w");
-     if (!out) {
- 	fclose(in);
--	sprintf(buf, _("G_put_title - can't create a temp file"));
--	G_warning(buf);
-+	G_warning(_("G_put_title - can't create a temp file"));
- 	return -1;
-     }
- 
-@@ -53,25 +50,22 @@ int G_put_cell_title(const char *name, const char *title)
- 
-     /* must be #cats line, title line, and label for cat 0 */
-     if (line < 3) {
--	sprintf(buf, _("category information for [%s] in [%s] invalid"), name,
-+	G_warning(_("category information for [%s] in [%s] invalid"), name,
- 		mapset);
--	G_warning(buf);
- 	return -1;
-     }
- 
-     in = fopen(tempfile, "r");
-     if (!in) {
--	sprintf(buf, _("G_put_title - can't reopen temp file"));
--	G_warning(buf);
-+	G_warning(_("G_put_title - can't reopen temp file"));
- 	return -1;
-     }
- 
-     out = G_fopen_new("cats", name);
-     if (!out) {
- 	fclose(in);
--	sprintf(buf, _("can't write category information for [%s] in [%s]"),
-+	G_warning(_("can't write category information for [%s] in [%s]"),
- 		name, mapset);
--	G_warning(buf);
- 	return -1;
-     }
- 
-diff --git a/lib/gis/quant_io.c b/lib/gis/quant_io.c
-index 15205ef..fbe2491 100644
---- a/lib/gis/quant_io.c
-+++ b/lib/gis/quant_io.c
-@@ -121,10 +121,9 @@ int G__quant_import(const char *name, const char *mapset, struct Quant *quant)
-     G_quant_free(quant);
- 
-     if (G_raster_map_type(name, mapset) == CELL_TYPE) {
--	sprintf(buf,
-+	G_warning(
- 		"G__quant_import: attempt to open quantization table for CELL_TYPE file [%s] in mapset {%s]",
- 		name, mapset);
--	G_warning(buf);
- 	return -2;
-     }
- 
-@@ -164,9 +163,8 @@ int G__quant_import(const char *name, const char *mapset, struct Quant *quant)
- 	err = "empty";
-     }
- 
--    sprintf(buf,
-+    G_warning(
- 	    _("quantization file [%s] in mapset [%s] %s"), name, mapset, err);
--    G_warning(buf);
- 
-     return 0;
- }
-diff --git a/lib/gis/quant_rw.c b/lib/gis/quant_rw.c
-index 2b7bf1b..4c069a8 100644
---- a/lib/gis/quant_rw.c
-+++ b/lib/gis/quant_rw.c
-@@ -63,16 +63,14 @@
- 
- int G_truncate_fp_map(const char *name, const char *mapset)
- {
--    char buf[300];
-     struct Quant quant;
- 
-     G_quant_init(&quant);
-     G_quant_truncate(&quant);
-     /* quantize the map */
-     if (G_write_quant(name, mapset, &quant) < 0) {
--	sprintf(buf, "G_truncate_fp_map: can't write quant rules for map %s",
-+	G_warning("G_truncate_fp_map: can't write quant rules for map %s",
- 		name);
--	G_warning(buf);
- 	return -1;
-     }
-     return 1;
-@@ -80,16 +78,14 @@ int G_truncate_fp_map(const char *name, const char *mapset)
- 
- int G_round_fp_map(const char *name, const char *mapset)
- {
--    char buf[300];
-     struct Quant quant;
- 
-     G_quant_init(&quant);
-     G_quant_round(&quant);
-     /* round the map */
-     if (G_write_quant(name, mapset, &quant) < 0) {
--	sprintf(buf, "G_truncate_fp_map: can't write quant rules for map %s",
-+	G_warning("G_truncate_fp_map: can't write quant rules for map %s",
- 		name);
--	G_warning(buf);
- 	return -1;
-     }
-     return 1;
-@@ -113,20 +109,17 @@ int G_round_fp_map(const char *name, const char *mapset)
- int G_quantize_fp_map(const char *name, const char *mapset,
- 		      CELL min, CELL max)
- {
--    char buf[300];
-     DCELL d_min, d_max;
-     struct FPRange fp_range;
- 
-     if (G_read_fp_range(name, mapset, &fp_range) < 0) {
--	sprintf(buf, "G_quantize_fp_map: can't read fp range for map %s",
-+	G_warning("G_quantize_fp_map: can't read fp range for map %s",
- 		name);
--	G_warning(buf);
- 	return -1;
-     }
-     G_get_fp_range_min_max(&fp_range, &d_min, &d_max);
-     if (G_is_d_null_value(&d_min) || G_is_d_null_value(&d_max)) {
--	sprintf(buf, "G_quantize_fp_map: raster map %s is empty", name);
--	G_warning(buf);
-+	G_warning("G_quantize_fp_map: raster map %s is empty", name);
- 	return -1;
-     }
-     return G_quantize_fp_map_range(name, mapset, d_min, d_max, min, max);
-@@ -159,17 +152,15 @@ int G_quantize_fp_map(const char *name, const char *mapset,
- int G_quantize_fp_map_range(const char *name, const char *mapset,
- 			    DCELL d_min, DCELL d_max, CELL min, CELL max)
- {
--    char buf[300];
-     struct Quant quant;
- 
-     G_quant_init(&quant);
-     G_quant_add_rule(&quant, d_min, d_max, min, max);
-     /* quantize the map */
-     if (G_write_quant(name, mapset, &quant) < 0) {
--	sprintf(buf,
-+	G_warning(
- 		"G_quantize_fp_map_range: can't write quant rules for map %s",
- 		name);
--	G_warning(buf);
- 	return -1;
-     }
-     return 1;
-@@ -200,11 +191,9 @@ int G_write_quant(const char *name, const char *mapset,
- {
-     CELL cell_min, cell_max;
-     DCELL d_min, d_max;
--    char buf[300];
- 
-     if (G_raster_map_type(name, mapset) == CELL_TYPE) {
--	sprintf(buf, _("Cannot write quant rules: map %s is integer"), name);
--	G_warning(buf);
-+	G_warning(_("Cannot write quant rules: map %s is integer"), name);
- 	return -1;
-     }
- 
-@@ -212,8 +201,7 @@ int G_write_quant(const char *name, const char *mapset,
- 
-     /* first actually write the rules */
-     if (G__quant_export(name, mapset, quant) < 0) {
--	sprintf(buf, _("Cannot write quant rules for map %s"), name);
--	G_warning(buf);
-+	G_warning(_("Cannot write quant rules for map %s"), name);
- 	return -1;
-     }
- 
-diff --git a/lib/gis/range.c b/lib/gis/range.c
-index ebd8232..a0f4dab 100644
---- a/lib/gis/range.c
-+++ b/lib/gis/range.c
-@@ -189,8 +189,7 @@ int G_read_fp_range(const char *name, const char *mapset,
-   error:
-     if (fd > 0)
- 	close(fd);
--    sprintf(buf, _("can't read f_range file for [%s in %s]"), name, mapset);
--    G_warning(buf);
-+    G_warning(buf, _("can't read f_range file for [%s in %s]"), name, mapset);
-     return -1;
- }
- 
-@@ -240,10 +239,9 @@ int G_read_range(const char *name, const char *mapset, struct Range *range)
- 	DCELL dmin, dmax;
- 
- 	if (G_read_quant(name, mapset, &quant) < 0) {
--	    sprintf(buf,
-+	    G_warning(buf,
- 		    "G_read_range(): can't read quant rules for fp map %s@%s",
- 		    name, mapset);
--	    G_warning(buf);
- 	    return -1;
- 	}
- 	if (G_quant_is_truncate(&quant) || G_quant_is_round(&quant)) {
-@@ -305,8 +303,7 @@ int G_read_range(const char *name, const char *mapset, struct Range *range)
-   error:
-     if (fd)
- 	fclose(fd);
--    sprintf(buf, _("can't read range file for [%s in %s]"), name, mapset);
--    G_warning(buf);
-+    G_warning(_("can't read range file for [%s in %s]"), name, mapset);
-     return -1;
- }
- 
-@@ -356,9 +353,8 @@ int G_write_range(const char *name, const struct Range *range)
- 
-   error:
-     G_remove_misc("cell_misc", "range", name);	/* remove the old file with this name */
--    sprintf(buf, _("can't write range file for [%s in %s]"),
-+    G_warning(_("can't write range file for [%s in %s]"),
- 	    name, G_mapset());
--    G_warning(buf);
-     return -1;
- }
- 
-@@ -409,9 +405,8 @@ int G_write_fp_range(const char *name, const struct FPRange *range)
- 
-   error:
-     G_remove(buf, "f_range");	/* remove the old file with this name */
--    sprintf(buf, _("can't write range file for [%s in %s]"),
-+    G_warning(_("can't write range file for [%s in %s]"),
- 	    name, G_mapset());
--    G_warning(buf);
-     return -1;
- }
- 
-diff --git a/lib/gis/seek.c b/lib/gis/seek.c
-index 747e103..e0a928a 100644
---- a/lib/gis/seek.c
-+++ b/lib/gis/seek.c
-@@ -49,12 +49,12 @@ void G_fseek(FILE *fp, off_t offset, int whence)
- {
- #ifdef HAVE_FSEEKO
-     if (fseeko(fp, offset, whence) != 0)
--	G_fatal_error(_("Unable to seek"));
-+	G_fatal_error("%s", _("Unable to seek"));
- #else
-     long loff = (long) offset;
-     if ((off_t) loff != offset)
--	G_fatal_error(_("Seek offset out of range"));
-+	G_fatal_error("%s", _("Seek offset out of range"));
-     if (fseek(fp, loff, whence) != 0)
--	G_fatal_error(_("Unable to seek"));
-+	G_fatal_error("%s", _("Unable to seek"));
- #endif     
- }
-diff --git a/lib/gmath/la.c b/lib/gmath/la.c
-index 7ca37c4..3205bfe 100644
---- a/lib/gmath/la.c
-+++ b/lib/gmath/la.c
-@@ -57,7 +57,7 @@ mat_struct *G_matrix_init(int rows, int cols, int ldim)
-     mat_struct *tmp_arry;
- 
-     if (rows < 1 || cols < 1 || ldim < rows) {
--	G_warning(_("Matrix dimensions out of range"));
-+	G_warning("%s", _("Matrix dimensions out of range"));
- 	return NULL;
-     }
- 
-@@ -113,7 +113,7 @@ int G_matrix_zero(mat_struct * A)
- int G_matrix_set(mat_struct * A, int rows, int cols, int ldim)
- {
-     if (rows < 1 || cols < 1 || ldim < 0) {
--	G_warning(_("Matrix dimensions out of range"));
-+	G_warning("%s", _("Matrix dimensions out of range"));
- 	return -1;
-     }
- 
-@@ -146,12 +146,12 @@ mat_struct *G_matrix_copy(const mat_struct * A)
-     mat_struct *B;
- 
-     if (!A->is_init) {
--	G_warning(_("Matrix is not initialised fully."));
-+	G_warning("%s", _("Matrix is not initialised fully."));
- 	return NULL;
-     }
- 
-     if ((B = G_matrix_init(A->rows, A->cols, A->ldim)) == NULL) {
--	G_warning(_("Unable to allocate space for matrix copy"));
-+	G_warning("%s", _("Unable to allocate space for matrix copy"));
- 	return NULL;
-     }
- 
-@@ -240,13 +240,13 @@ mat_struct *G__matrix_add(mat_struct * mt1, mat_struct * mt2, const double c1,
-     int i, j;			/* loop variables */
- 
-     if (c1 == 0) {
--	G_warning(_("First scalar multiplier must be non-zero"));
-+	G_warning("%s", _("First scalar multiplier must be non-zero"));
- 	return NULL;
-     }
- 
-     if (c2 == 0) {
- 	if (!mt1->is_init) {
--	    G_warning(_("One or both input matrices uninitialised"));
-+	    G_warning("%s", _("One or both input matrices uninitialised"));
- 	    return NULL;
- 	}
-     }
-@@ -254,18 +254,18 @@ mat_struct *G__matrix_add(mat_struct * mt1, mat_struct * mt2, const double c1,
-     else {
- 
- 	if (!((mt1->is_init) && (mt2->is_init))) {
--	    G_warning(_("One or both input matrices uninitialised"));
-+	    G_warning("%s", _("One or both input matrices uninitialised"));
- 	    return NULL;
- 	}
- 
- 	if (mt1->rows != mt2->rows || mt1->cols != mt2->cols) {
--	    G_warning(_("Matrix order does not match"));
-+	    G_warning("%s", _("Matrix order does not match"));
- 	    return NULL;
- 	}
-     }
- 
-     if ((mt3 = G_matrix_init(mt1->rows, mt1->cols, mt1->ldim)) == NULL) {
--	G_warning(_("Unable to allocate space for matrix sum"));
-+	G_warning("%s", _("Unable to allocate space for matrix sum"));
- 	return NULL;
-     }
- 
-@@ -319,17 +319,17 @@ mat_struct *G_matrix_product(mat_struct * mt1, mat_struct * mt2)
-     integer1 no_trans = 'n';
- 
-     if (!((mt1->is_init) || (mt2->is_init))) {
--	G_warning(_("One or both input matrices uninitialised"));
-+	G_warning("%s", _("One or both input matrices uninitialised"));
- 	return NULL;
-     }
- 
-     if (mt1->cols != mt2->rows) {
--	G_warning(_("Matrix order does not match"));
-+	G_warning("%s", _("Matrix order does not match"));
- 	return NULL;
-     }
- 
-     if ((mt3 = G_matrix_init(mt1->rows, mt2->cols, mt1->ldim)) == NULL) {
--	G_warning(_("Unable to allocate space for matrix product"));
-+	G_warning("%s", _("Unable to allocate space for matrix product"));
- 	return NULL;
-     }
- 
-@@ -441,29 +441,29 @@ G_matrix_LU_solve(const mat_struct * mt1, mat_struct ** xmat0,
-     mat_struct *wmat, *xmat, *mtx;
- 
-     if (mt1->is_init == 0 || bmat->is_init == 0) {
--	G_warning(_("Input: one or both data matrices uninitialised"));
-+	G_warning("%s", _("Input: one or both data matrices uninitialised"));
- 	return -1;
-     }
- 
-     if (mt1->rows != mt1->cols || mt1->rows < 1) {
--	G_warning(_("Principal matrix is not properly dimensioned"));
-+	G_warning("%s", _("Principal matrix is not properly dimensioned"));
- 	return -1;
-     }
- 
-     if (bmat->cols < 1) {
--	G_warning(_("Input: you must have at least one array to solve"));
-+	G_warning("%s", _("Input: you must have at least one array to solve"));
- 	return -1;
-     }
- 
-     /* Now create solution matrix by copying the original coefficient matrix */
-     if ((xmat = G_matrix_copy(bmat)) == NULL) {
--	G_warning(_("Could not allocate space for solution matrix"));
-+	G_warning("%s", _("Could not allocate space for solution matrix"));
- 	return -1;
-     }
- 
-     /* Create working matrix for the coefficient array */
-     if ((mtx = G_matrix_copy(mt1)) == NULL) {
--	G_warning(_("Could not allocate space for working matrix"));
-+	G_warning("%s", _("Could not allocate space for working matrix"));
- 	return -1;
-     }
- 
-@@ -471,7 +471,7 @@ G_matrix_LU_solve(const mat_struct * mt1, mat_struct ** xmat0,
-        original information 
-      */
-     if ((wmat = G_matrix_copy(bmat)) == NULL) {
--	G_warning(_("Could not allocate space for working matrix"));
-+	G_warning("%s", _("Could not allocate space for working matrix"));
- 	return -1;
-     }
- 
-@@ -524,18 +524,18 @@ G_matrix_LU_solve(const mat_struct * mt1, mat_struct ** xmat0,
- 	    G_matrix_free(mtx);
- 
- 	    if (res_info > 0) {
--		G_warning(_("Matrix (or submatrix is singular). Solution undetermined"));
-+		G_warning("%s", _("Matrix (or submatrix is singular). Solution undetermined"));
- 		return 1;
- 	    }
- 	    else if (res_info < 0) {
--		G_warning(_("Problem in LA routine."));
-+		G_warning("%s", _("Problem in LA routine."));
- 		return -1;
- 	    }
- 	    break;
+--- grass-7.0.3/db/drivers/mysql/dbe.c.orig	2012-01-31 22:30:42.000000000 +0100
++++ grass-7.0.3/db/drivers/mysql/dbe.c	2016-04-04 17:02:48.983020982 +0200
+@@ -43,7 +43,7 @@
+ 
+ 	if (!replace_variables(name, &datadir, &database)) {
+ 	    db_d_append_error(_("Unable parse MySQL embedded database name"));
+-	    db_d_append_error(mysql_error(connection));
++	    db_d_append_error("%s", mysql_error(connection));
+ 	    db_d_report_error();
+ 	    return DB_FAILED;
+ 	}
+@@ -59,7 +59,7 @@
+ 
+ 	if (mysql_server_init(4, server_args, NULL)) {
+ 	    db_d_append_error(_("Cannot initialize MySQL embedded server"));
+-	    db_d_append_error(mysql_error(connection));
++	    db_d_append_error("%s", mysql_error(connection));
+ 	    db_d_report_error();
+ 	    free(datadir);
+ 	    free(database);
+@@ -78,7 +78,7 @@
+ 
+ 	if (res == NULL) {
+ 	    db_d_append_error(_("Unable to connect to MySQL embedded server: "));
+-	    db_d_append_error(mysql_error(connection));
++	    db_d_append_error("%s", mysql_error(connection));
+ 	    db_d_report_error();
+ 	    return DB_FAILED;
  	}
-     default:
- 	{
--	    G_warning(_("Procedure not yet available for selected matrix type"));
-+	    G_warning("%s", _("Procedure not yet available for selected matrix type"));
- 	    return -1;
- 	}
-     }				/* end switch */
-@@ -569,12 +569,12 @@ mat_struct *G_matrix_inverse(mat_struct * mt)
-     int i, j, k;		/* loop */
- 
-     if (mt->rows != mt->cols) {
--	G_warning(_("Matrix is not square. Cannot determine inverse"));
-+	G_warning("%s", _("Matrix is not square. Cannot determine inverse"));
- 	return NULL;
-     }
- 
-     if ((mt0 = G_matrix_init(mt->rows, mt->rows, mt->ldim)) == NULL) {
--	G_warning(_("Unable to allocate space for matrix"));
-+	G_warning("%s", _("Unable to allocate space for matrix"));
- 	return NULL;
-     }
- 
-@@ -591,12 +591,12 @@ mat_struct *G_matrix_inverse(mat_struct * mt)
- 
-     /* Solve system */
-     if ((k = G_matrix_LU_solve(mt, &res, mt0, NONSYM)) == 1) {
--	G_warning(_("Matrix is singular"));
-+	G_warning("%s", _("Matrix is singular"));
- 	G_matrix_free(mt0);
- 	return NULL;
-     }
-     else if (k < 0) {
--	G_warning(_("Problem in LA procedure."));
-+	G_warning("%s", _("Problem in LA procedure."));
- 	G_matrix_free(mt0);
- 	return NULL;
-     }
-@@ -684,12 +684,12 @@ void G_matrix_print(mat_struct * mt)
- int G_matrix_set_element(mat_struct * mt, int rowval, int colval, double val)
- {
-     if (!mt->is_init) {
--	G_warning(_("Element array has not been allocated"));
-+	G_warning("%s", _("Element array has not been allocated"));
- 	return -1;
-     }
- 
-     if (rowval >= mt->rows || colval >= mt->cols || rowval < 0 || colval < 0) {
--	G_warning(_("Specified element is outside array bounds"));
-+	G_warning("%s", _("Specified element is outside array bounds"));
- 	return -1;
-     }
- 
-@@ -743,17 +743,17 @@ vec_struct *G_matvect_get_column(mat_struct * mt, int col)
-     vec_struct *vc1;
- 
-     if (col < 0 || col >= mt->cols) {
--	G_warning(_("Specified matrix column index is outside range"));
-+	G_warning("%s", _("Specified matrix column index is outside range"));
- 	return NULL;
-     }
- 
-     if (!mt->is_init) {
--	G_warning(_("Matrix is not initialised"));
-+	G_warning("%s", _("Matrix is not initialised"));
- 	return NULL;
-     }
- 
-     if ((vc1 = G_vector_init(mt->rows, mt->ldim, CVEC)) == NULL) {
--	G_warning(_("Could not allocate space for vector structure"));
-+	G_warning("%s", _("Could not allocate space for vector structure"));
- 	return NULL;
-     }
- 
-@@ -784,17 +784,17 @@ vec_struct *G_matvect_get_row(mat_struct * mt, int row)
-     vec_struct *vc1;
- 
-     if (row < 0 || row >= mt->cols) {
--	G_warning(_("Specified matrix row index is outside range"));
-+	G_warning("%s", _("Specified matrix row index is outside range"));
- 	return NULL;
-     }
- 
-     if (!mt->is_init) {
--	G_warning(_("Matrix is not initialised"));
-+	G_warning("%s", _("Matrix is not initialised"));
- 	return NULL;
-     }
- 
-     if ((vc1 = G_vector_init(mt->cols, mt->ldim, RVEC)) == NULL) {
--	G_warning(_("Could not allocate space for vector structure"));
-+	G_warning("%s", _("Could not allocate space for vector structure"));
- 	return NULL;
-     }
- 
-@@ -824,12 +824,12 @@ vec_struct *G_matvect_get_row(mat_struct * mt, int row)
- int G_matvect_extract_vector(mat_struct * mt, vtype vt, int indx)
- {
-     if (vt == RVEC && indx >= mt->rows) {
--	G_warning(_("Specified row index is outside range"));
-+	G_warning("%s", _("Specified row index is outside range"));
- 	return -1;
-     }
- 
-     else if (vt == CVEC && indx >= mt->cols) {
--	G_warning(_("Specified column index is outside range"));
-+	G_warning("%s", _("Specified column index is outside range"));
- 	return -1;
-     }
- 
-@@ -849,7 +849,7 @@ int G_matvect_extract_vector(mat_struct * mt, vtype vt, int indx)
- 
-     default:
- 	{
--	    G_warning(_("Unknown vector type."));
-+	    G_warning("%s", _("Unknown vector type."));
- 	    return -1;
- 	}
- 
-@@ -974,34 +974,34 @@ vec_struct *G_vector_sub(vec_struct * v1, vec_struct * v2, vec_struct * out)
-     int i;
- 
-     if (!out->is_init) {
--	G_warning(_("Output vector is uninitialized"));
-+	G_warning("%s", _("Output vector is uninitialized"));
- 	return NULL;
-     }
- 
-     if (v1->type != v2->type) {
--	G_warning(_("Vectors are not of the same type"));
-+	G_warning("%s", _("Vectors are not of the same type"));
- 	return NULL;
-     }
- 
-     if (v1->type != out->type) {
--	G_warning(_("Output vector is of incorrect type"));
-+	G_warning("%s", _("Output vector is of incorrect type"));
- 	return NULL;
-     }
- 
-     if (v1->type == MATRIX_) {
--	G_warning(_("Matrices not allowed"));
-+	G_warning("%s", _("Matrices not allowed"));
- 	return NULL;
-     }
- 
-     if ((v1->type == ROWVEC_ && v1->cols != v2->cols) ||
- 	(v1->type == COLVEC_ && v1->rows != v2->rows)) {
--	G_warning(_("Vectors have differing dimensions"));
-+	G_warning("%s", _("Vectors have differing dimensions"));
- 	return NULL;
-     }
- 
-     if ((v1->type == ROWVEC_ && v1->cols != out->cols) ||
- 	(v1->type == COLVEC_ && v1->rows != out->rows)) {
--	G_warning(_("Output vector has incorrect dimension"));
-+	G_warning("%s", _("Output vector has incorrect dimension"));
- 	return NULL;
-     }
- 
-@@ -1047,12 +1047,12 @@ int G_vector_set(vec_struct * A, int cells, int ldim, vtype vt, int vindx)
- {
-     if ((cells < 1) || (vt == RVEC && ldim < 1)
- 	|| (vt == CVEC && ldim < cells) || ldim < 0) {
--	G_warning(_("Vector dimensions out of range"));
-+	G_warning("%s", _("Vector dimensions out of range"));
- 	return -1;
-     }
- 
-     if ((vt == RVEC && vindx >= A->cols) || (vt == CVEC && vindx >= A->rows)) {
--	G_warning(_("Row/column out of range"));
-+	G_warning("%s", _("Row/column out of range"));
- 	return -1;
-     }
- 
-@@ -1229,7 +1229,7 @@ double G_vector_norm1(vec_struct * vc)
-     int i;
- 
-     if (!vc->is_init) {
--	G_warning(_("Matrix is not initialised"));
-+	G_warning("%s", _("Matrix is not initialised"));
- 	return 0.0 / 0.0;	/* NaN */
-     }
- 
-@@ -1267,7 +1267,7 @@ vec_struct *G_vector_copy(const vec_struct * vc1, int comp_flag)
-     int cnt;
- 
-     if (!vc1->is_init) {
--	G_warning(_("Vector structure is not initialised"));
-+	G_warning("%s", _("Vector structure is not initialised"));
- 	return NULL;
-     }
- 
-@@ -1388,7 +1388,7 @@ int G_matrix_read(FILE * fp, mat_struct * out)
-     }
- 
-     if (sscanf(buff, "Matrix: %d by %d", &rows, &cols) != 2) {
--	G_warning(_("Input format error"));
-+	G_warning("%s", _("Input format error"));
- 	return -1;
-     }
- 
-@@ -1396,12 +1396,12 @@ int G_matrix_read(FILE * fp, mat_struct * out)
- 
-     for (i = 0; i < rows; i++) {
- 	if (fscanf(fp, "row%d:", &row) != 1 || row != i) {
--	    G_warning(_("Input format error"));
-+	    G_warning("%s", _("Input format error"));
- 	    return -1;
- 	}
- 	for (j = 0; j < cols; j++) {
- 	    if (fscanf(fp, "%lf:", &val) != 1) {
--		G_warning(_("Input format error"));
-+		G_warning("%s", _("Input format error"));
- 		return -1;
- 	    }
- 
-diff --git a/lib/proj/datum.c b/lib/proj/datum.c
-index 43a3365..dfb8a55 100644
---- a/lib/proj/datum.c
-+++ b/lib/proj/datum.c
-@@ -320,7 +320,7 @@ int GPJ_ask_datum_params(const char *datumname, char **params)
- 	    /* Search through the linked list to find the parameter string
- 	     * that corresponds to the number entered */
- 	    if (list->count == currenttransform)
--		G_asprintf(params, list->params);
-+		G_asprintf(params, "%s", list->params);
- 
- 	    /* Continue to end of list even after we find it, to free all
- 	     * the memory used */
-@@ -347,7 +347,7 @@ int GPJ_ask_datum_params(const char *datumname, char **params)
- 	    G_strip(answer);
- 	    if (strlen(answer) == 0)
- 		return -1;
--	    G_asprintf(params, answer);
-+	    G_asprintf(params, "%s", answer);
- 	    sprintf(buff,
- 		    "Parameters to be used are:\n\"%s\"\nIs this correct?",
- 		    *params);
-diff --git a/lib/proj/get_proj.c b/lib/proj/get_proj.c
-index 1a4e840..0ba19a5 100644
---- a/lib/proj/get_proj.c
-+++ b/lib/proj/get_proj.c
-@@ -234,7 +234,7 @@ int pj_get_kv(struct pj_info *info, struct Key_Value *in_proj_keys,
- 	    sprintf(err, " +%s", opt_in[i]);
- 	    strcat(buffa, err);
- 	}
--	G_warning(buffa);
-+	G_warning("%s", buffa);
- 	G_warning(_("The error message: %s"), pj_strerrno(pj_errno));
- 	return -1;
-     }
-diff --git a/lib/raster/io_sock.c b/lib/raster/io_sock.c
-index 0a43f6d..fa90045 100644
---- a/lib/raster/io_sock.c
-+++ b/lib/raster/io_sock.c
-@@ -60,8 +60,8 @@ int REM_open_driver(void)
- 
-     if (!name) {
- 	if (verbose) {
--	    G_warning(_("No graphics monitor has been selected for output."));
--	    G_warning(_("Please run \"d.mon\" to select a graphics monitor."));
-+	    G_warning("%s", _("No graphics monitor has been selected for output."));
-+	    G_warning("%s", _("Please run \"d.mon\" to select a graphics monitor."));
- 	}
- 	return (NO_MON);
-     }
-@@ -69,7 +69,7 @@ int REM_open_driver(void)
-     /* Get the full path to the unix socket */
-     if ((sockpath = G_sock_get_fname(name)) == NULL) {
- 	if (verbose)
--	    G_warning(_("Failed to get socket name for monitor <%s>."), name);
-+	    G_warning("%s", _("Failed to get socket name for monitor <%s>."), name);
- 	return (NO_MON);
-     }
- 
-@@ -78,7 +78,7 @@ int REM_open_driver(void)
-      */
-     if (!G_sock_exists(sockpath)) {
- 	if (verbose)
--	    G_warning(_("No socket to connect to for monitor <%s>."), name);
-+	    G_warning("%s", _("No socket to connect to for monitor <%s>."), name);
- 	return (NO_MON);
-     }
- 
-@@ -95,21 +95,21 @@ int REM_open_driver(void)
-     case ECONNREFUSED:
-     case EADDRINUSE:
- 	if (verbose) {
--	    G_warning(_("Socket is already in use or not accepting connections."));
--	    G_warning(_("Use d.mon to select a monitor"));
-+	    G_warning("%s", _("Socket is already in use or not accepting connections."));
-+	    G_warning("%s", _("Use d.mon to select a monitor"));
- 	}
- 	return (NO_RUN);
-     case EBADF:
-     case ENOTSOCK:
- 	if (verbose) {
--	    G_warning(_("Trying to connect to something not a socket."));
--	    G_warning(_("Probably program error."));
-+	    G_warning("%s", _("Trying to connect to something not a socket."));
-+	    G_warning("%s", _("Probably program error."));
- 	}
- 	return (NO_RUN);
-     case ETIMEDOUT:
- 	if (verbose) {
--	    G_warning(_("Connect attempt timed out."));
--	    G_warning(_("Probably an error with the server."));
-+	    G_warning("%s", _("Connect attempt timed out."));
-+	    G_warning("%s", _("Probably an error with the server."));
- 	}
- 	return (NO_RUN);
-     default:
-@@ -117,7 +117,7 @@ int REM_open_driver(void)
-     }
- 
-     if (verbose)
--	G_warning(_("Connection failed."));
-+	G_warning("%s", _("Connection failed."));
- 
-     /* We couldn't connect... */
-     return (NO_RUN);
-diff --git a/lib/sites/sites.c b/lib/sites/sites.c
-index d4fef09..0a10ea1 100644
---- a/lib/sites/sites.c
-+++ b/lib/sites/sites.c
-@@ -240,7 +240,7 @@ int G_site_get_head(struct Map_info *Map, Site_head * head)
- 	     (struct TimeStamp *)G_malloc(sizeof(struct TimeStamp))) == NULL)
- 	    G_fatal_error(_("Memory error in allocating timestamp"));
- 	if (G_scan_timestamp(head->time, head->stime) < 0) {
--	    G_warning(datetime_error_msg());
-+	    G_warning("%s", datetime_error_msg());
- 
- 	    head->time = NULL;
- 	    head->stime = NULL;
-diff --git a/lib/symbol/read.c b/lib/symbol/read.c
-index c0b0c46..037c827 100644
---- a/lib/symbol/read.c
-+++ b/lib/symbol/read.c
-@@ -221,7 +221,7 @@ SYMBOL *err(FILE * fp, SYMBOL * s, char *msg)
- {
-     fclose(fp);
-     G_free(s);			/* TODO: free all */
--    G_warning(msg);
-+    G_warning("%s", msg);
-     return NULL;
- }
- 
-diff --git a/lib/vector/Vlib/open.c b/lib/vector/Vlib/open.c
-index bfb2953..aa05ab7 100644
---- a/lib/vector/Vlib/open.c
-+++ b/lib/vector/Vlib/open.c
-@@ -60,10 +60,10 @@ static void fatal_error(int ferror, char *errmsg)
- {
-     switch (ferror) {
-     case GV_FATAL_EXIT:
--	G_fatal_error(errmsg);
-+	G_fatal_error("%s", errmsg);
- 	break;
-     case GV_FATAL_PRINT:
--	G_warning(errmsg);
-+	G_warning("%s", errmsg);
- 	break;
-     case GV_FATAL_RETURN:
- 	break;
-diff --git a/raster/r.describe/describe.c b/raster/r.describe/describe.c
-index 719de3e..da6fdb3 100644
---- a/raster/r.describe/describe.c
-+++ b/raster/r.describe/describe.c
-@@ -46,7 +46,7 @@ int describe(char *name, char *mapset, int compact, char *no_data_str,
- 	if (G_get_cellhd(name, mapset, &window) < 0) {
- 	    sprintf(msg, "can't get cell header for [%s] in [%s]", name,
- 		    mapset);
--	    G_fatal_error(msg);
-+	    G_fatal_error("%s", msg);
- 	}
- 	G_set_window(&window);
- 	get_row = G_get_c_raster_row_nomask;
-diff --git a/raster/r.external/main.c b/raster/r.external/main.c
-index ab72f0f..09c2eca 100644
---- a/raster/r.external/main.c
-+++ b/raster/r.external/main.c
-@@ -174,7 +174,7 @@ static void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, int ove
- 	    strcat(error_msg,
- 		   _("Consider generating a new location from the input dataset using "
- 		     "the 'location' parameter.\n"));
--	    G_fatal_error(error_msg);
-+	    G_fatal_error("%s", error_msg);
- 	}
- 	else {
- 	    G_message(_("Projection of input dataset and current location "
-diff --git a/raster/r.flow/mem.h b/raster/r.flow/mem.h
-index 169e487..6e44f29 100644
---- a/raster/r.flow/mem.h
-+++ b/raster/r.flow/mem.h
-@@ -37,7 +37,7 @@ void put_row_seg( /* l, row */ );
- 		   segment_get_row(l.seg, l.buf[row] - l.col_offset, \
- 				          row + l.row_offset) < 1)) ? \
- 	(sprintf(string, "r.flow: cannot write segment file for %s", l.name),\
--	 G_fatal_error(string), (DCELL *) NULL) : \
-+	 G_fatal_error("%s", string), (DCELL *) NULL) : \
- 	l.buf[row])
- 
- /*   This was is Astley's version 12...
-@@ -56,7 +56,7 @@ void put_row_seg( /* l, row */ );
- 	(segment_get(as.seg, &v, \
- 			row + as.row_offset, col + as.col_offset) < 1 ? \
- 	  (sprintf(string,"r.flow: cannot read segment file for %s",as.name), \
--	   G_fatal_error(string)) : \
-+	   G_fatal_error("%s", string)) : \
- 	  v) : \
- 	(parm.mem ? \
- 	   aspect_fly(el.buf[row - 1] + col, \
-@@ -68,7 +68,7 @@ void put_row_seg( /* l, row */ );
-     (parm.seg ? \
- 	(segment_get(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
- 	  (sprintf(string,"r.flow: cannot read segment file for %s",l.name),\
--	   G_fatal_error(string)) : \
-+	   G_fatal_error("%s", string)) : \
- 	 v) : \
- 	l.buf[row][col])
- 
-@@ -77,6 +77,6 @@ void put_row_seg( /* l, row */ );
- 	(v = w, \
- 	 segment_put(l.seg, &v, row + l.row_offset, col + l.col_offset) < 1 ? \
- 	  (sprintf(string,"r.flow: cannot write segment file for %s",l.name), \
--	   G_fatal_error(string)) : \
-+	   G_fatal_error("%s", string)) : \
- 	 0) : \
- 	(l.buf[row][col] = w))
-diff --git a/raster/r.in.arc/gethead.c b/raster/r.in.arc/gethead.c
-index 10105ee..3a25d96 100644
---- a/raster/r.in.arc/gethead.c
-+++ b/raster/r.in.arc/gethead.c
-@@ -86,7 +86,7 @@ int gethead(FILE * fd, struct Cell_head *cellhd, int *missingval)
- 	}
- 
- 	G_warning(_("Illegal line in header"));
--	G_warning(buf);
-+	G_warning("%s", buf);
- 
- 	missing(s, "yllcorner");
- 	missing(w, "xllcorner");
-@@ -98,7 +98,7 @@ int gethead(FILE * fd, struct Cell_head *cellhd, int *missingval)
-     }
- 
-     if (err = G_adjust_Cell_head(cellhd, 1, 1)) {
--	G_warning(err);
-+	G_warning("%s", err);
- 	return 0;
-     }
- 
-diff --git a/raster/r.in.ascii/gethead.c b/raster/r.in.ascii/gethead.c
-index 086670d..ea8e610 100644
---- a/raster/r.in.ascii/gethead.c
-+++ b/raster/r.in.ascii/gethead.c
-@@ -221,7 +221,7 @@ int gethead(FILE * fd,
-     }
- 
-     if ((err = G_adjust_Cell_head(cellhd, 1, 1))) {
--	G_warning(err);
-+	G_warning("%s", err);
- 	return 0;
-     }
- 
-diff --git a/raster/r.in.gdal/main.c b/raster/r.in.gdal/main.c
-index 81ba40c..62fedb7 100644
---- a/raster/r.in.gdal/main.c
-+++ b/raster/r.in.gdal/main.c
-@@ -443,7 +443,7 @@ int main(int argc, char *argv[])
- 		strcat(error_msg,
- 		       _("Consider generating a new location from the input dataset using "
- 			"the 'location' parameter.\n"));
--		G_fatal_error(error_msg);
-+		G_fatal_error("%s", error_msg);
- 	    }
- 	    else {
- 		G_message(_("Projection of input dataset and current location "
-@@ -688,7 +688,7 @@ static void SetupReprojector(const char *pszSrcWKT, const char *pszDstLoc,
- 		target_mapset, pszDstLoc);
- 	strcat(errbuf, permissions == 0 ? _("permission denied")
- 	       : _("not found"));
--	G_fatal_error(errbuf);
-+	G_fatal_error("%s", errbuf);
-     }				/* permission check */
- 
-     /* And switch back to original location */
-diff --git a/raster/r.in.mat/main.c b/raster/r.in.mat/main.c
-index 4b7da0f..1927924 100644
---- a/raster/r.in.mat/main.c
-+++ b/raster/r.in.mat/main.c
-@@ -407,10 +407,10 @@ int main(int argc, char *argv[])
-     region.zone = G_zone();
-     buff = G_adjust_Cell_head(&region, 1, 1);
-     if (buff)
--	G_fatal_error(buff);
-+	G_fatal_error("%s", buff);
-     G_set_window(&region);
- 
--    G_verbose_message("");
-+    G_verbose_message("%s", "");
-     G_verbose_message(_("Map <%s> bounds set to:"), map_name);
-     G_verbose_message(_("northern edge=%f"), region.north);
-     G_verbose_message(_("southern edge=%f"), region.south);
-@@ -420,7 +420,7 @@ int main(int argc, char *argv[])
-     G_verbose_message(_("ewres=%f"), region.ew_res);
-     G_verbose_message(_("rows=%d"), region.rows);
-     G_verbose_message(_("cols=%d"), region.cols);
--    G_verbose_message("");
-+    G_verbose_message("%s", "");
- 
-     /* prep memory */
-     raster = G_allocate_raster_buf(map_type);
-diff --git a/raster/r.in.xyz/main.c b/raster/r.in.xyz/main.c
-index 527ea3b..a2fc1f0 100644
---- a/raster/r.in.xyz/main.c
-+++ b/raster/r.in.xyz/main.c
-@@ -1059,7 +1059,7 @@ int main(int argc, char *argv[])
- 
- 
-     sprintf(buff, _("%lu points found in region."), count_total);
--    G_done_msg(buff);
-+    G_done_msg("%s", buff);
-     G_debug(1, "Processed %lu lines.", line);
- 
-     exit(EXIT_SUCCESS);
-diff --git a/raster/r.le/r.le.patch/driver.c b/raster/r.le/r.le.patch/driver.c
-index 32d26ae..db368bd 100644
---- a/raster/r.le/r.le.patch/driver.c
-+++ b/raster/r.le/r.le.patch/driver.c
-@@ -2565,12 +2565,9 @@ void read_line(char *name, int line, int n, int *value, int *fvalue,
- 	    }
- 	}
- 	if (3 > (fvalue[0] = (float)i)) {
--	    buf = G_malloc(40);
--	    sprintf(buf,
-+	    G_fatal_error(
- 		    "\n No data in file\"%s\"; use r.le.setup to make file\n",
- 		    path);
--	    G_fatal_error(buf);
--	    G_free(buf);
- 	}
-     }
-     fclose(fp);
-diff --git a/raster/r.out.vrml/main.c b/raster/r.out.vrml/main.c
-index 8bb9470..5d60635 100644
---- a/raster/r.out.vrml/main.c
-+++ b/raster/r.out.vrml/main.c
-@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
-     int elevfd = 0, colorfd = 0;
-     FILE *vout = NULL;
-     struct Colors colr;
--    char errbuf[100], outfile[256];
-+    char outfile[256];
-     int shh, color_ok;
-     double exag, min, max;
-     struct GModule *module;
-@@ -84,13 +84,11 @@ int main(int argc, char *argv[])
-     t_mapset = NULL;
-     t_mapset = G_find_file2("cell", rast_el->answer, "");
-     if (!t_mapset) {
--	sprintf(errbuf, "Couldn't find raster map %s", rast_el->answer);
--	G_fatal_error(errbuf);
-+	G_fatal_error("Couldn't find raster map %s", rast_el->answer);
-     }
-     if ((elevfd = G_open_cell_old(rast_el->answer, t_mapset)) == -1) {
--	sprintf(errbuf, "Not able to open cellfile for [%s]",
-+	G_fatal_error("Not able to open cellfile for [%s]",
- 		rast_el->answer);
--	G_fatal_error(errbuf);
-     }
- 
-     {
-@@ -103,10 +101,9 @@ int main(int argc, char *argv[])
- 	is_fp = G_raster_map_is_fp(rast_el->answer, t_mapset);
- 	if (is_fp) {
- 	    if (G_read_fp_range(rast_el->answer, t_mapset, &fp_range) != 1) {
--		sprintf(errbuf,
-+		G_fatal_error(
- 			"Range info for [%s] not available (run r.support)\n",
- 			rast_el->answer);
--		G_fatal_error(errbuf);
- 	    }
- 	    G_get_fp_range_min_max(&fp_range, &dmin, &dmax);
- 	    min = dmin;
-@@ -114,10 +111,9 @@ int main(int argc, char *argv[])
- 	}
- 	else {
- 	    if (G_read_range(rast_el->answer, t_mapset, &range) == -1) {
--		sprintf(errbuf,
-+		G_fatal_error(
- 			"Range info for [%s] not available (run r.support)\n",
- 			rast_el->answer);
--		G_fatal_error(errbuf);
- 	    }
- 	    G_get_range_min_max(&range, &cmin, &cmax);
- 	    min = cmin;
-@@ -129,13 +125,11 @@ int main(int argc, char *argv[])
- 	t_mapset = NULL;
- 	t_mapset = G_find_file2("cell", rast_co->answer, "");
- 	if (!t_mapset) {
--	    sprintf(errbuf, "Couldn't find raster map %s", rast_co->answer);
--	    G_warning(errbuf);
-+	    G_warning("Couldn't find raster map %s", rast_co->answer);
- 	}
- 	else if ((colorfd = G_open_cell_old(rast_co->answer, t_mapset)) == -1) {
--	    sprintf(errbuf, "Not able to open cellfile for [%s]",
-+	    G_warning("Not able to open cellfile for [%s]",
- 		    rast_co->answer);
--	    G_warning(errbuf);
- 	}
- 	else {
- 	    G_read_colors(rast_co->answer, t_mapset, &colr);
-@@ -162,8 +156,7 @@ int main(int argc, char *argv[])
- 	/* open file for writing VRML */
- 	G_message(_("Opening %s for writing... "), outfile);
- 	if (NULL == (vout = fopen(outfile, "w"))) {
--	    sprintf(errbuf, "Couldn't open output file %s", outfile);
--	    G_fatal_error(errbuf);
-+	    G_fatal_error("Couldn't open output file %s", outfile);
- 	}
-     }
- 
-diff --git a/raster/r.profile/main.c b/raster/r.profile/main.c
-index 167c1cd..e107279 100644
---- a/raster/r.profile/main.c
-+++ b/raster/r.profile/main.c
-@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
- 	sprintf(formatbuff, _("[Along Track Dist.(m)] [Elevation]"));
-     if (clr)
- 	strcat(formatbuff, _(" [RGB Color]"));
--    G_message(formatbuff);
-+    G_message("%s", formatbuff);
- 
-     /* Get Profile Start Coords */
-     if (!parm.profile->answer && !parm.i->answer) {
-diff --git a/raster/r.profile/read_rast.c b/raster/r.profile/read_rast.c
-index 0892002..5b77f6a 100644
---- a/raster/r.profile/read_rast.c
-+++ b/raster/r.profile/read_rast.c
-@@ -46,7 +46,7 @@ int read_rast(double east, double north, double dist, int fd, int coords,
- 			  row);
- 
- 	if (outofbounds || G_is_c_null_value(&cell[col]))
--	    sprintf(buf, null_string);
-+	    sprintf(buf, "%s", null_string);
- 	else
- 	    sprintf(buf, "%d", cell[col]);
- 
-@@ -74,7 +74,7 @@ int read_rast(double east, double north, double dist, int fd, int coords,
- 			  row);
- 
- 	if (outofbounds || G_is_f_null_value(&fcell[col]))
--	    sprintf(buf, null_string);
-+	    sprintf(buf, "%s", null_string);
- 	else
- 	    sprintf(buf, "%f", fcell[col]);
- 
-@@ -102,7 +102,7 @@ int read_rast(double east, double north, double dist, int fd, int coords,
- 			  row);
- 
- 	if (outofbounds || G_is_d_null_value(&dcell[col]))
--	    sprintf(buf, null_string);
-+	    sprintf(buf, "%s", null_string);
- 	else
- 	    sprintf(buf, "%f", dcell[col]);
- 
-diff --git a/raster/r.quant/main.c b/raster/r.quant/main.c
-index f648d6f..80d6038 100644
---- a/raster/r.quant/main.c
-+++ b/raster/r.quant/main.c
-@@ -24,7 +24,6 @@
- 
- int main(int argc, char *argv[])
- {
--    char buf[1024];
-     struct GModule *module;
-     struct Option *input, *basemap, *fprange, *range;
-     struct Flag *trunc, *rnd;
-@@ -93,14 +92,12 @@ int main(int argc, char *argv[])
- 	name[noi] = G_store(input->answers[noi]);
- 	mapset[noi] = G_find_cell2(name[noi], "");
- 	if (mapset[noi] == NULL) {
--	    sprintf(buf, "%s - not found", name[noi]);
--	    G_fatal_error(buf);
-+	    G_fatal_error("%s - not found", name[noi]);
- 	}
- 
- 	if (G_raster_map_type(name[noi], mapset[noi]) == CELL_TYPE) {
--	    sprintf(buf, "%s is integer map, it can't be quantized",
-+	    G_fatal_error("%s is integer map, it can't be quantized",
- 		    name[noi]);
--	    G_fatal_error(buf);
- 	}
-     }
- 
-@@ -122,20 +119,17 @@ int main(int argc, char *argv[])
-     {
- 	basemapset = G_find_cell2(basename, "");
- 	if (basemapset == NULL) {
--	    sprintf(buf, "%s - not found", basename);
--	    G_fatal_error(buf);
-+	    G_fatal_error("%s - not found", basename);
- 	}
- 
- 	if (G_raster_map_type(basename, basemapset) == CELL_TYPE) {
--	    sprintf(buf, "%s is integer map, it can't be used as basemap",
-+	    G_fatal_error("%s is integer map, it can't be used as basemap",
- 		    basename);
--	    G_fatal_error(buf);
- 	}
- 
- 	if (G_read_quant(basename, basemapset, &quant_struct) <= 0) {
--	    sprintf(buf, "Can't read quant rules for basemap %s! Exiting.",
-+	    G_fatal_error("Can't read quant rules for basemap %s! Exiting.",
- 		    basename);
--	    G_fatal_error(buf);
- 	}
-     }
- 
-diff --git a/raster/r.quant/read_rules.c b/raster/r.quant/read_rules.c
-index 82a6779..0c38c0a 100644
---- a/raster/r.quant/read_rules.c
-+++ b/raster/r.quant/read_rules.c
-@@ -12,20 +12,17 @@ int read_range(void)
-     struct Range range;
-     CELL tmp_min, tmp_max;
-     DCELL tmp_dmin, tmp_dmax;
--    char buff[1024];
-     int i;
- 
-     /* read the fpranges and ranges of all input maps */
-     for (i = 0; i < noi; i++) {
- 	if (G_read_fp_range(name[i], mapset[i], &drange) <= 0) {
--	    sprintf(buff, "Can't read f_range for map %s", name[i]);
--	    G_fatal_error(buff);
-+	    G_fatal_error("Can't read f_range for map %s", name[i]);
- 	}
- 	G_get_fp_range_min_max(&drange, &tmp_dmin, &tmp_dmax);
- 
- 	if (G_read_range(name[i], mapset[i], &range) <= 0) {
--	    sprintf(buff, "Can't read range for map %s", name[i]);
--	    G_fatal_error(buff);
-+	    G_fatal_error("Can't read range for map %s", name[i]);
- 	}
- 	G_get_range_min_max(&range, &tmp_min, &tmp_max);
- 	if (!i || tmp_max > old_max || G_is_c_null_value(&old_max))
-diff --git a/raster/r.random.surface/init.c b/raster/r.random.surface/init.c
-index b4fdbae..955ac11 100644
---- a/raster/r.random.surface/init.c
-+++ b/raster/r.random.surface/init.c
-@@ -207,7 +207,7 @@ void Init(int argc, char **argv)
- 		Seeds[i] = Seeds[i] % SEED_MAX;
- 		sprintf(msg2, _(" seed is set to %d"), Seeds[i]);
- 		strcat(msg, msg2);
--		G_warning(msg);
-+		G_warning("%s", msg);
- 	    }
- 	    else if (Seeds[i] < SEED_MIN) {
- 		sprintf(msg, _("Seed (%d) smaller than minimum (%d)"),
-@@ -216,7 +216,7 @@ void Init(int argc, char **argv)
- 		    Seeds[i] += SEED_MAX - SEED_MIN;
- 		sprintf(msg2, _(" seed is set to %d"), Seeds[i]);
- 		strcat(msg, msg2);
--		G_warning(msg);
-+		G_warning("%s", msg);
- 	    }
- 	}			/* /for */
-     }				/* /else */
-diff --git a/raster/r.reclass/main.c b/raster/r.reclass/main.c
-index dcbcd0c..362b937 100644
---- a/raster/r.reclass/main.c
-+++ b/raster/r.reclass/main.c
-@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
- 	    }
- 	    else {
- 		strcat(buf, _(" - invalid reclass rule"));
--		G_fatal_error(buf);
-+		G_fatal_error("%s", buf);
- 	    }
- 	    break;
- 
-diff --git a/raster/r.resamp.rst/main.c b/raster/r.resamp.rst/main.c
-index e84965b..5032d38 100644
---- a/raster/r.resamp.rst/main.c
-+++ b/raster/r.resamp.rst/main.c
-@@ -718,5 +718,5 @@ void clean_fatal_error(char *str)
- 	fclose(Tmp_fd_xy);
- 	unlink(Tmp_file_xy);
-     }
--    G_fatal_error(str);
-+    G_fatal_error("%s", str);
- }
-diff --git a/raster/r.rescale.eq/main.c b/raster/r.rescale.eq/main.c
-index 2b0ebd2..52998fa 100644
---- a/raster/r.rescale.eq/main.c
-+++ b/raster/r.rescale.eq/main.c
-@@ -115,11 +115,11 @@ int main(int argc, char *argv[])
-     mapset = G_find_cell(old_name, "");
-     if (mapset == NULL) {
- 	sprintf(buf, "%s - not found\n", old_name);
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
-     if (G_legal_filename(new_name) < 0) {
- 	sprintf(buf, "%s - illegal map name\n", new_name);
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
- 
-     get_stats(old_name, mapset, &statf);
-diff --git a/raster/r.rescale/main.c b/raster/r.rescale/main.c
-index ef1113f..1e9469f 100644
---- a/raster/r.rescale/main.c
-+++ b/raster/r.rescale/main.c
-@@ -110,11 +110,11 @@ int main(int argc, char *argv[])
-     mapset = G_find_cell(old_name, "");
-     if (mapset == NULL) {
- 	sprintf(buf, "%s - not found\n", old_name);
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
-     if (G_legal_filename(new_name) < 0) {
- 	sprintf(buf, "%s - illegal map name\n", new_name);
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
- 
-     if (parm.from->answer) {
-diff --git a/raster/r.surf.contour/bseg_get.c b/raster/r.surf.contour/bseg_get.c
-index c70902a..0bb4b6f 100644
---- a/raster/r.surf.contour/bseg_get.c
-+++ b/raster/r.surf.contour/bseg_get.c
-@@ -4,13 +4,11 @@
- int bseg_get(BSEG * bseg, char * value, int row, int col)
- {
-     unsigned char x;
--    char errmsg[200];
- 
-     if (segment_get(&(bseg->seg), &x, row, col >> 3) < 0) {
--	sprintf(errmsg,
-+	G_warning(
- 		"bseg_get(): could not read segment file at r:%d c:%d",
- 		(int)row, (int)col);
--	G_warning(errmsg);
- 	return -1;
-     }
-     *value = (char) ((x & (1 << (col & 7))) ? 1 : 0);
-diff --git a/raster/r.surf.contour/bseg_put.c b/raster/r.surf.contour/bseg_put.c
-index 31010d8..036363f 100644
---- a/raster/r.surf.contour/bseg_put.c
-+++ b/raster/r.surf.contour/bseg_put.c
-@@ -4,13 +4,11 @@
- int bseg_put(BSEG * bseg, char * value, int row, int col)
- {
-     unsigned char old_value;
--    char errmsg[200];
- 
-     if (segment_get(&(bseg->seg), &old_value, row, col >> 3) < 0) {
--	sprintf(errmsg,
-+	G_warning(
- 		"bseg_put(): could not read segment file at r:%d c:%d",
- 		(int)row, (int)col);
--	G_warning(errmsg);
- 	return -1;
-     }
-     if (*value)
-@@ -18,10 +16,9 @@ int bseg_put(BSEG * bseg, char * value, int row, int col)
-     else
- 	old_value &= ~(1 << (col & 7));
-     if (segment_put(&(bseg->seg), &old_value, row, col >> 3) < 0) {
--	sprintf(errmsg,
-+	G_warning(
- 		"bseg_put(): could not write segment file at r:%d c:%d",
- 		(int)row, (int)col);
--	G_warning(errmsg);
- 	return -2;
-     }
-     return 0;
-diff --git a/raster/r.surf.contour/bseg_read.c b/raster/r.surf.contour/bseg_read.c
-index 8fbf4c2..a2df0ef 100644
---- a/raster/r.surf.contour/bseg_read.c
-+++ b/raster/r.surf.contour/bseg_read.c
-@@ -9,7 +9,6 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
-     int row, nrows;
-     int col, ncols;
-     int map_fd;
--    char msg[100];
-     CELL *buffer;
-     char value;
- 
-@@ -18,9 +17,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
- 
-     map_fd = G_open_cell_old(map_name, mapset);
-     if (map_fd < 0) {
--	sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
-+	G_warning("%s(): unable to open file [%s] in [%s], %d",
- 		me, map_name, mapset, map_fd);
--	G_warning(msg);
- 	return -3;
-     }
-     nrows = G_window_rows();
-@@ -30,9 +28,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
- 	if (G_get_map_row(map_fd, buffer, row) < 0) {
- 	    G_free(buffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
-+	    G_warning("%s(): unable to read file [%s] in [%s], %d %d",
- 		    me, map_name, mapset, row, nrows);
--	    G_warning(msg);
- 	    return -2;
- 	}
- 	for (col = ncols; col >= 0; col--) {
-diff --git a/raster/r.surf.contour/dseg_read.c b/raster/r.surf.contour/dseg_read.c
-index af5362d..83ccaa1 100644
---- a/raster/r.surf.contour/dseg_read.c
-+++ b/raster/r.surf.contour/dseg_read.c
-@@ -8,16 +8,14 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
- {
-     int row, nrows;
-     int map_fd;
--    char msg[100];
-     DCELL *buffer;
- 
-     dseg->name = NULL;
-     dseg->mapset = NULL;
- 
-     if ((map_fd = G_open_cell_old(map_name, mapset)) < 0) {
--	sprintf(msg, "%s(): unable to open file [%s] in [%s]",
-+	G_warning("%s(): unable to open file [%s] in [%s]",
- 		me, map_name, mapset);
--	G_warning(msg);
- 	return -3;
-     }
-     nrows = G_window_rows();
-@@ -26,17 +24,15 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
- 	if (G_get_d_raster_row(map_fd, buffer, row) < 0) {
- 	    G_free(buffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to read file [%s] in [%s]",
-+	    G_warning("%s(): unable to read file [%s] in [%s]",
- 		    me, map_name, mapset);
--	    G_warning(msg);
- 	    return -2;
- 	}
- 	if (segment_put_row(&(dseg->seg), buffer, row) < 0) {
- 	    G_free(buffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to segment put row for [%s] in [%s]",
-+	    G_warning("%s(): unable to segment put row for [%s] in [%s]",
- 		    me, map_name, mapset);
--	    G_warning(msg);
- 	    return (-1);
- 	}
-     }
-diff --git a/raster/r.surf.contour/dseg_write.c b/raster/r.surf.contour/dseg_write.c
-index 126e65e..0a369dd 100644
---- a/raster/r.surf.contour/dseg_write.c
-+++ b/raster/r.surf.contour/dseg_write.c
-@@ -7,13 +7,11 @@ int dseg_write_cellfile(DSEG * dseg, char *map_name)
- {
-     int map_fd;
-     int row, nrows;
--    char msg[100];
-     DCELL *buffer;
- 
-     map_fd = G_open_raster_new(map_name, DCELL_TYPE);
-     if (map_fd < 0) {
--	sprintf(msg, "%s(): unable to open new map layer [%s]", me, map_name);
--	G_warning(msg);
-+	G_warning("%s(): unable to open new map layer [%s]", me, map_name);
- 	return -1;
-     }
-     nrows = G_window_rows();
-@@ -23,10 +21,9 @@ int dseg_write_cellfile(DSEG * dseg, char *map_name)
- 	if (G_put_raster_row(map_fd, buffer, DCELL_TYPE) < 0) {
- 	    G_free(buffer);
- 	    G_unopen_cell(map_fd);
--	    sprintf(msg,
-+	    G_warning(
- 		    "%s(): unable to write new map layer [%s], row %d",
- 		    me, map_name, row);
--	    G_warning(msg);
- 	    return -2;
- 	}
-     }
-diff --git a/raster/r.to.rast3/main.c b/raster/r.to.rast3/main.c
-index a36f086..f47835a 100644
---- a/raster/r.to.rast3/main.c
-+++ b/raster/r.to.rast3/main.c
-@@ -63,7 +63,7 @@ void fatal_error(void *map, int *fd, int depths, char *errorMsg)
- 	    close_input_raster_map(fd[i]);
-     }
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
-     exit(EXIT_FAILURE);
- 
- }
-@@ -205,7 +205,7 @@ int main(int argc, char *argv[])
- 
-     /*Check for output */
-     if (param.output->answer == NULL)
--	G3d_fatalError(_("No output map"));
-+	G3d_fatalError("%s", _("No output map"));
- 
-     /* Figure out the region from the map */
-     G3d_initDefaults();
-@@ -338,7 +338,7 @@ int main(int argc, char *argv[])
- 
-     /* Close files and exit */
-     if (!G3d_closeCell(map))
--	G3d_fatalError(_("Error closing 3d raster map"));
-+	G3d_fatalError("%s", _("Error closing 3d raster map"));
- 
-     map = NULL;
- 
-diff --git a/raster/r.to.rast3elev/main.c b/raster/r.to.rast3elev/main.c
-index 340460b..8b52489 100644
---- a/raster/r.to.rast3elev/main.c
-+++ b/raster/r.to.rast3elev/main.c
-@@ -189,7 +189,7 @@ void fatal_error(Database db, char *errorMsg)
-     if (db.elev)
- 	close_input_raster_map(db.elev);
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
-     exit(EXIT_FAILURE);
- }
- 
-diff --git a/raster/r.to.vect/areas_io.c b/raster/r.to.vect/areas_io.c
-index 9677ea7..d68a5fa 100644
---- a/raster/r.to.vect/areas_io.c
-+++ b/raster/r.to.vect/areas_io.c
-@@ -365,7 +365,7 @@ int write_area(struct area_table *a_list,	/* list of areas */
- 		}
- 
- 		db_append_string(&sql, ")");
--		G_debug(3, db_get_string(&sql));
-+		G_debug(3, "%s", db_get_string(&sql));
- 
- 		if (db_execute_immediate(driver, &sql) != DB_OK)
- 		    G_fatal_error(_("Cannot insert new row: %s"),
-diff --git a/raster/r.to.vect/main.c b/raster/r.to.vect/main.c
-index 556d977..d849d29 100644
---- a/raster/r.to.vect/main.c
-+++ b/raster/r.to.vect/main.c
-@@ -189,7 +189,7 @@ int main(int argc, char *argv[])
- 
- 	db_append_string(&sql, ")");
- 
--	G_debug(3, db_get_string(&sql));
-+	G_debug(3, "%s", db_get_string(&sql));
- 
- 	if (db_execute_immediate(driver, &sql) != DB_OK)
- 	    G_fatal_error(_("Unable to create table: %s"),
-@@ -268,7 +268,7 @@ int main(int argc, char *argv[])
- 		sprintf(buf, "insert into %s values ( %d, '%s')", Fi->table,
- 			cat, db_get_string(&label));
- 		db_set_string(&sql, buf);
--		G_debug(3, db_get_string(&sql));
-+		G_debug(3, "%s", db_get_string(&sql));
- 
- 		if (db_execute_immediate(driver, &sql) != DB_OK)
- 		    G_fatal_error(_("Unable to insert into table: %s"),
-diff --git a/raster/r.to.vect/util.c b/raster/r.to.vect/util.c
-index dfdff50..d537104 100644
---- a/raster/r.to.vect/util.c
-+++ b/raster/r.to.vect/util.c
-@@ -150,7 +150,7 @@ void insert_value(int cat, int val, double dval)
- 
-     db_append_string(&sql, ")");
- 
--    G_debug(3, db_get_string(&sql));
-+    G_debug(3, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK)
- 	G_fatal_error(_("Cannot insert new row: %s"), db_get_string(&sql));
-diff --git a/raster/r.volume/main.c b/raster/r.volume/main.c
-index 1d2fe73..ab739e6 100644
---- a/raster/r.volume/main.c
-+++ b/raster/r.volume/main.c
-@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
- 			"Row=%d Col=%d Cat=%d in clump map [%s]; max=%d.\n",
- 			row, col, i, clumpmap, max);
- 		strcat(buf, "Cat value > max returned by G_number_of_cats.");
--		G_fatal_error(buf);
-+		G_fatal_error("%s", buf);
- 	    }
- 	    if (i < 1)
- 		continue;	/* ignore zeros and negs */
-diff --git a/raster/r.water.outlet/legal.c b/raster/r.water.outlet/legal.c
-index 3615668..0a97bd9 100644
---- a/raster/r.water.outlet/legal.c
-+++ b/raster/r.water.outlet/legal.c
-@@ -8,7 +8,7 @@ int do_legal(char *file_name)
- 
-     if (G_legal_filename(file_name) == -1) {
- 	G_asprintf(&buf, _("<%s> is an illegal file name"), file_name);
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
- 
-     return 0;
-@@ -21,7 +21,7 @@ char *do_exist(char *file_name)
-     file_mapset = G_find_cell2(file_name, "");
-     if (file_mapset == NULL) {
- 	G_asprintf(&buf, _("Raster map <%s> not found"), file_name);
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
-     return (file_mapset);
- }
-diff --git a/raster/r.water.outlet/main.c b/raster/r.water.outlet/main.c
-index 5d74772..4fab739 100644
---- a/raster/r.water.outlet/main.c
-+++ b/raster/r.water.outlet/main.c
-@@ -83,7 +83,7 @@ int main(int argc, char *argv[])
- 
-     if (G_get_window(&window) < 0) {
- 	G_asprintf(&buf, _("Unable to read current window parameters"));
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
- 
-     strcpy(drain_name, opt1->answer);
-diff --git a/raster/r.watershed/seg/bseg_read.c b/raster/r.watershed/seg/bseg_read.c
-index 9c0b0f9..f507931 100644
---- a/raster/r.watershed/seg/bseg_read.c
-+++ b/raster/r.watershed/seg/bseg_read.c
-@@ -9,7 +9,6 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
-     int row, nrows;
-     int col, ncols;
-     int map_fd;
--    char msg[100];
-     CELL *buffer;
- 
-     bseg->name = NULL;
-@@ -17,9 +16,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
- 
-     map_fd = G_open_cell_old(map_name, mapset);
-     if (map_fd < 0) {
--	sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
-+	G_warning("%s(): unable to open file [%s] in [%s], %d",
- 		me, map_name, mapset, map_fd);
--	G_warning(msg);
- 	return -3;
-     }
-     nrows = G_window_rows();
-@@ -29,9 +27,8 @@ int bseg_read_cell(BSEG * bseg, char *map_name, char *mapset)
- 	if (G_get_c_raster_row(map_fd, buffer, row) < 0) {
- 	    G_free(buffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
-+	    G_warning("%s(): unable to read file [%s] in [%s], %d %d",
- 		    me, map_name, mapset, row, nrows);
--	    G_warning(msg);
- 	    return -2;
- 	}
- 	for (col = ncols; col >= 0; col--) {
-diff --git a/raster/r.watershed/seg/cseg_read.c b/raster/r.watershed/seg/cseg_read.c
-index 14e5f27..3f25a95 100644
---- a/raster/r.watershed/seg/cseg_read.c
-+++ b/raster/r.watershed/seg/cseg_read.c
-@@ -8,7 +8,6 @@ int cseg_read_cell(CSEG * cseg, char *map_name, char *mapset)
- {
-     int row, nrows;
-     int map_fd;
--    char msg[100];
-     CELL *buffer;
- 
-     cseg->name = NULL;
-@@ -16,9 +15,8 @@ int cseg_read_cell(CSEG * cseg, char *map_name, char *mapset)
- 
-     map_fd = G_open_cell_old(map_name, mapset);
-     if (map_fd < 0) {
--	sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
-+	G_warning("%s(): unable to open file [%s] in [%s], %d",
- 		me, map_name, mapset, map_fd);
--	G_warning(msg);
- 	return -3;
-     }
-     nrows = G_window_rows();
-@@ -27,17 +25,15 @@ int cseg_read_cell(CSEG * cseg, char *map_name, char *mapset)
- 	if (G_get_c_raster_row(map_fd, buffer, row) < 0) {
- 	    G_free(buffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
-+	    G_warning("%s(): unable to read file [%s] in [%s], %d %d",
- 		    me, map_name, mapset, row, nrows);
--	    G_warning(msg);
- 	    return -2;
- 	}
- 	if (segment_put_row(&(cseg->seg), buffer, row) < 0) {
- 	    G_free(buffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to segment put row for [%s] in [%s]",
-+	    G_warning("%s(): unable to segment put row for [%s] in [%s]",
- 		    me, map_name, mapset);
--	    G_warning(msg);
- 	    return (-1);
- 	}
-     }
-diff --git a/raster/r.watershed/seg/dseg_read.c b/raster/r.watershed/seg/dseg_read.c
-index 4d5cd51..f7ab151 100644
---- a/raster/r.watershed/seg/dseg_read.c
-+++ b/raster/r.watershed/seg/dseg_read.c
-@@ -8,7 +8,6 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
- {
-     int row, nrows, ncols;
-     int map_fd;
--    char msg[100];
-     double *dbuffer;
- 
-     dseg->name = NULL;
-@@ -16,9 +15,8 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
- 
-     map_fd = G_open_cell_old(map_name, mapset);
-     if (map_fd < 0) {
--	sprintf(msg, "%s(): unable to open file [%s] in [%s], %d",
-+	G_warning("%s(): unable to open file [%s] in [%s], %d",
- 		me, map_name, mapset, map_fd);
--	G_warning(msg);
- 	return -3;
-     }
-     nrows = G_window_rows();
-@@ -28,17 +26,15 @@ int dseg_read_cell(DSEG * dseg, char *map_name, char *mapset)
- 	if (G_get_d_raster_row(map_fd, dbuffer, row) < 0) {
- 	    G_free(dbuffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to read file [%s] in [%s], %d %d",
-+	    G_warning("%s(): unable to read file [%s] in [%s], %d %d",
- 		    me, map_name, mapset, row, nrows);
--	    G_warning(msg);
- 	    return -2;
- 	}
- 	if (segment_put_row(&(dseg->seg), (DCELL *) dbuffer, row) < 0) {
- 	    G_free(dbuffer);
- 	    G_close_cell(map_fd);
--	    sprintf(msg, "%s(): unable to segment put row for [%s] in [%s]",
-+	    G_warning("%s(): unable to segment put row for [%s] in [%s]",
- 		    me, map_name, mapset);
--	    G_warning(msg);
- 	    return (-1);
- 	}
-     }
-diff --git a/raster/r.what/die.c b/raster/r.what/die.c
-index f22e45c..5c253de 100644
---- a/raster/r.what/die.c
-+++ b/raster/r.what/die.c
-@@ -6,7 +6,7 @@ void die(char *a, char *b)
-     char *message;
- 
-     G_asprintf(&message, "%s: %s %s", G_program_name(), a, b);
--    G_fatal_error(message);
-+    G_fatal_error("%s", message);
- 
-     return;
- }
-diff --git a/raster/wildfire/r.spread/collect_ori.c b/raster/wildfire/r.spread/collect_ori.c
-index fe2eaa3..e958410 100644
---- a/raster/wildfire/r.spread/collect_ori.c
-+++ b/raster/wildfire/r.spread/collect_ori.c
-@@ -48,7 +48,6 @@ void collect_ori(int start_fd)
-     extern CELL *cell;
-     extern CELL *map_base, *map_x_out, *map_y_out, *map_visit;
-     extern float *map_out;
--    extern char buf[];
-     extern float neg, zero;
-     extern int BARRIER;
-     extern int nrows, ncols;
-@@ -65,10 +64,9 @@ void collect_ori(int start_fd)
- 	    if (*(cell + col) > 0) {
- 		/*Check if starting sources legally ? */
- 		if (DATA(map_base, row, col) <= 0) {
--		    sprintf(buf,
-+		    G_warning(
- 			    "can't start from a BARRIER at cell (%d,%d), request ignored\n",
- 			    col, row);
--		    G_warning(buf);
- 		    continue;
- 		}
- 
-diff --git a/raster3d/r3.cross.rast/main.c b/raster3d/r3.cross.rast/main.c
-index 4fbf50c..b027c04 100644
---- a/raster3d/r3.cross.rast/main.c
-+++ b/raster3d/r3.cross.rast/main.c
-@@ -62,7 +62,7 @@ void fatal_error(void *map, int elevfd, int outfd, char *errorMsg)
-     if (elevfd != -1)
- 	close_output_map(elevfd);
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
-     exit(EXIT_FAILURE);
- 
- }
-diff --git a/raster3d/r3.in.ascii/main.c b/raster3d/r3.in.ascii/main.c
-index 1b959e1..924c342 100644
---- a/raster3d/r3.in.ascii/main.c
-+++ b/raster3d/r3.in.ascii/main.c
-@@ -56,7 +56,7 @@ static void fatalError(char *errorMsg)
- 	G3d_closeCell(map);
-     }
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
- }
- 
- /*---------------------------------------------------------------------------*/
-diff --git a/raster3d/r3.in.v5d/main.c b/raster3d/r3.in.v5d/main.c
-index 827c199..4867b65 100644
---- a/raster3d/r3.in.v5d/main.c
-+++ b/raster3d/r3.in.v5d/main.c
-@@ -46,7 +46,7 @@ static void fatalError(char *errorMsg)
- 	/* should unopen map here! */
-     }
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
- }
- 
- /*---------------------------------------------------------------------------*/
-diff --git a/raster3d/r3.out.ascii/main.c b/raster3d/r3.out.ascii/main.c
-index 1059cde..8181348 100644
---- a/raster3d/r3.out.ascii/main.c
-+++ b/raster3d/r3.out.ascii/main.c
-@@ -59,7 +59,7 @@ void fatalError(char *errorMsg)
- 
-     }
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
- }
- 
- /*---------------------------------------------------------------------------*/
-diff --git a/raster3d/r3.out.v5d/main.c b/raster3d/r3.out.v5d/main.c
-index 96cb985..ec8b0d5 100644
---- a/raster3d/r3.out.v5d/main.c
-+++ b/raster3d/r3.out.v5d/main.c
-@@ -54,7 +54,7 @@ void fatalError(char *errorMsg)
- 	    fatalError(_("Unable to close 3D raster map"));
-     }
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
- }
- 
- /*---------------------------------------------------------------------------*/
-diff --git a/raster3d/r3.to.rast/main.c b/raster3d/r3.to.rast/main.c
-index 7f794ed..b7712df 100644
---- a/raster3d/r3.to.rast/main.c
-+++ b/raster3d/r3.to.rast/main.c
-@@ -60,7 +60,7 @@ void fatal_error(void *map, int *fd, int depths, char *errorMsg)
- 	    G_unopen_cell(fd[i]);
-     }
- 
--    G3d_fatalError(errorMsg);
-+    G3d_fatalError("%s", errorMsg);
-     exit(EXIT_FAILURE);
- 
- }
-diff --git a/vector/v.convert/att.c b/vector/v.convert/att.c
-index 36acbd7..db442f6 100644
---- a/vector/v.convert/att.c
-+++ b/vector/v.convert/att.c
-@@ -60,7 +60,7 @@ int attributes(char *in, struct Map_info *Out)
- 	    fi->table, clen);
-     db_append_string(&sql, buf);
- 
--    G_debug(1, db_get_string(&sql));
-+    G_debug(1, "%s", db_get_string(&sql));
- 
-     driver = db_start_driver(fi->driver);
-     if (driver == NULL)
-@@ -102,7 +102,7 @@ int attributes(char *in, struct Map_info *Out)
- 	sprintf(buf, "insert into %s values ( %d, '%s')", fi->table, cat,
- 		db_get_string(&lab));
- 	db_set_string(&sql, buf);
--	G_debug(3, db_get_string(&sql));
-+	G_debug(3, "%s", db_get_string(&sql));
- 
- 	if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	    db_close_database(driver);
-diff --git a/vector/v.in.ascii/in.c b/vector/v.in.ascii/in.c
-index d7bbe5d..21f506e 100644
---- a/vector/v.in.ascii/in.c
-+++ b/vector/v.in.ascii/in.c
-@@ -380,7 +380,7 @@ int main(int argc, char *argv[])
- 				Fi->driver);
- 
- 	    /* Create table */
--	    G_debug(3, db_get_string(&sql));
-+	    G_debug(3, "%s", db_get_string(&sql));
- 	    if (db_execute_immediate(driver, &sql) != DB_OK) {
- 		Vect_delete(new->answer);
- 		G_fatal_error(_("Unable to create table: %s"),
-diff --git a/vector/v.in.ascii/points.c b/vector/v.in.ascii/points.c
-index 02ee5e4..ef0e47c 100644
---- a/vector/v.in.ascii/points.c
-+++ b/vector/v.in.ascii/points.c
-@@ -399,7 +399,7 @@ int points_to_bin(FILE * ascii, int rowlen, struct Map_info *Map,
- 		db_append_string(&sql, buf2);
- 	    }
- 	    db_append_string(&sql, ")");
--	    G_debug(3, db_get_string(&sql));
-+	    G_debug(3, "%s", db_get_string(&sql));
- 
- 	    if (db_execute_immediate(driver, &sql) != DB_OK) {
- 		G_fatal_error(_("Unable to insert new record: %s"),
-diff --git a/vector/v.in.dwg/entity.c b/vector/v.in.dwg/entity.c
-index 0311113..203d6d6 100644
---- a/vector/v.in.dwg/entity.c
-+++ b/vector/v.in.dwg/entity.c
-@@ -262,7 +262,7 @@ int write_line(PAD_ENT_HDR adenhd, int type, int level)
-     db_append_string(&sql, buf);
- 
-     db_append_string(&sql, ")");
--    G_debug(3, db_get_string(&sql));
-+    G_debug(3, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database(driver);
-diff --git a/vector/v.in.dwg/main.c b/vector/v.in.dwg/main.c
-index bb7cc63..abde533 100644
---- a/vector/v.in.dwg/main.c
-+++ b/vector/v.in.dwg/main.c
-@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
- 		initerror, adErrorStr(initerror));
- 	if (initerror == AD_UNABLE_TO_OPEN_INIT_FILE)
- 	    sprintf(buf, _("%s Cannot open %s"), buf, path);
--	G_fatal_error(buf);
-+	G_fatal_error("%s", buf);
-     }
-     adSetupDwgRead();
-     adSetupDxfRead();
-@@ -211,7 +211,7 @@ int main(int argc, char *argv[])
- 		Fi->table);
-     }
-     db_set_string(&sql, buf);
--    G_debug(3, db_get_string(&sql));
-+    G_debug(3, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database(driver);
-diff --git a/vector/v.in.ogr/main.c b/vector/v.in.ogr/main.c
-index d0d558e..e5b409f 100644
---- a/vector/v.in.ogr/main.c
-+++ b/vector/v.in.ogr/main.c
-@@ -595,7 +595,7 @@ int main(int argc, char *argv[])
- 	    strcat(error_msg,
- 		   _("Consider generating a new location with 'location' parameter"
- 		    " from input data set.\n"));
--	    G_fatal_error(error_msg);
-+	    G_fatal_error("%s", error_msg);
- 	}
- 	else {
- 	    G_message(_("Projection of input dataset and current location "
-@@ -779,7 +779,7 @@ int main(int argc, char *argv[])
- 		G_free(Ogr_fieldname);
- 	    }
- 	    db_append_string(&sql, ")");
--	    G_debug(3, db_get_string(&sql));
-+	    G_debug(3, "%s", db_get_string(&sql));
- 
- 	    driver =
- 		db_start_driver_open_database(Fi->driver,
-@@ -931,7 +931,7 @@ int main(int argc, char *argv[])
- 		    db_append_string(&sql, buf);
- 		}
- 		db_append_string(&sql, " )");
--		G_debug(3, db_get_string(&sql));
-+		G_debug(3, "%s", db_get_string(&sql));
- 
- 		if (db_execute_immediate(driver, &sql) != DB_OK) {
- 		    db_close_database(driver);
-diff --git a/vector/v.in.sites/main.c b/vector/v.in.sites/main.c
-index 4162c06..66ff3f6 100644
---- a/vector/v.in.sites/main.c
-+++ b/vector/v.in.sites/main.c
-@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
-     }
-     db_append_string(&sql, ")");
- 
--    G_debug(1, db_get_string(&sql));
-+    G_debug(1, "%s", db_get_string(&sql));
- 
-     driver = db_start_driver(fi->driver);
-     if (driver == NULL)
-@@ -232,7 +232,7 @@ int main(int argc, char *argv[])
- 
- 	db_append_string(&sql, ")");
- 
--	G_debug(3, db_get_string(&sql));
-+	G_debug(3, "%s", db_get_string(&sql));
- 
- 	if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	    db_close_database(driver);
-diff --git a/vector/v.net.allpairs/main.c b/vector/v.net.allpairs/main.c
-index a92fc96..3d3636b 100644
---- a/vector/v.net.allpairs/main.c
-+++ b/vector/v.net.allpairs/main.c
-@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
- 	    Fi->table);
- 
-     db_set_string(&sql, buf);
--    G_debug(2, db_get_string(&sql));
-+    G_debug(2, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
-@@ -234,7 +234,7 @@ int main(int argc, char *argv[])
- 	    sprintf(buf, "insert into %s values (%d, %d, %f)",
- 		    Fi->table, spnode[i].cat, spnode[j].cat, cost);
- 	    db_set_string(&sql, buf);
--	    G_debug(3, db_get_string(&sql));
-+	    G_debug(3, "%s", db_get_string(&sql));
- 
- 	    if (db_execute_immediate(driver, &sql) != DB_OK) {
- 		db_close_database_shutdown_driver(driver);
-diff --git a/vector/v.net.centrality/main.c b/vector/v.net.centrality/main.c
-index d5b2fad..79c8629 100644
---- a/vector/v.net.centrality/main.c
-+++ b/vector/v.net.centrality/main.c
-@@ -233,7 +233,7 @@ int main(int argc, char *argv[])
- 	    "create table %s(cat integer%s)", Fi->table, db_get_string(&tmp));
- 
-     db_set_string(&sql, buf);
--    G_debug(2, db_get_string(&sql));
-+    G_debug(2, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
-diff --git a/vector/v.net.components/main.c b/vector/v.net.components/main.c
-index 6503baa..c8193ef 100644
---- a/vector/v.net.components/main.c
-+++ b/vector/v.net.components/main.c
-@@ -31,7 +31,7 @@ int insert_new_record(dbDriver * driver, struct field_info *Fi,
- 
-     sprintf(buf, "insert into %s values (%d, %d)", Fi->table, cat, comp);
-     db_set_string(sql, buf);
--    G_debug(3, db_get_string(sql));
-+    G_debug(3, "%s", db_get_string(sql));
- 
-     if (db_execute_immediate(driver, sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
-@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
-     sprintf(buf, "create table %s ( cat integer, comp integer)", Fi->table);
- 
-     db_set_string(&sql, buf);
--    G_debug(2, db_get_string(&sql));
-+    G_debug(2, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
-diff --git a/vector/v.net.distance/main.c b/vector/v.net.distance/main.c
-index cb2a639..4af3e04 100644
---- a/vector/v.net.distance/main.c
-+++ b/vector/v.net.distance/main.c
-@@ -201,7 +201,7 @@ int main(int argc, char *argv[])
- 	    Fi->table);
- 
-     db_set_string(&sql, buf);
--    G_debug(2, db_get_string(&sql));
-+    G_debug(2, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
-@@ -250,7 +250,7 @@ int main(int argc, char *argv[])
- 		    tcat, cost);
- 
- 	    db_set_string(&sql, buf);
--	    G_debug(3, db_get_string(&sql));
-+	    G_debug(3, "%s", db_get_string(&sql));
- 	    if (db_execute_immediate(driver, &sql) != DB_OK) {
- 		db_close_database_shutdown_driver(driver);
- 		G_fatal_error(_("Cannot insert new record: %s"),
-diff --git a/vector/v.net.flow/main.c b/vector/v.net.flow/main.c
-index d4ea47e..662bba1 100644
---- a/vector/v.net.flow/main.c
-+++ b/vector/v.net.flow/main.c
-@@ -161,7 +161,7 @@ int main(int argc, char *argv[])
- 	    Fi->table);
- 
-     db_set_string(&sql, buf);
--    G_debug(2, db_get_string(&sql));
-+    G_debug(2, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
-@@ -237,7 +237,7 @@ int main(int argc, char *argv[])
- 	    sprintf(buf, "insert into %s values (%d, %f)", Fi->table, cat,
- 		    flow[i] / (double)In.cost_multip);
- 	    db_set_string(&sql, buf);
--	    G_debug(3, db_get_string(&sql));
-+	    G_debug(3, "%s", db_get_string(&sql));
- 
- 	    if (db_execute_immediate(driver, &sql) != DB_OK) {
- 		db_close_database_shutdown_driver(driver);
-diff --git a/vector/v.net.path/path.c b/vector/v.net.path/path.c
-index 321e4ad..8cec95f 100644
---- a/vector/v.net.path/path.c
-+++ b/vector/v.net.path/path.c
-@@ -102,7 +102,7 @@ int path(struct Map_info *In, struct Map_info *Out, char *filename,
- 	    Fi->table);
- 
-     db_set_string(&sql, buf);
--    G_debug(2, db_get_string(&sql));
-+    G_debug(2, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
-@@ -302,7 +302,7 @@ int path(struct Map_info *In, struct Map_info *Out, char *filename,
- 		"insert into %s values ( %d, %d, %d, %d, %d, %f, %f, %f)",
- 		Fi->table, cat, id, fcat, tcat, sp, cost, fdist, tdist);
- 	db_set_string(&sql, buf);
--	G_debug(3, db_get_string(&sql));
-+	G_debug(3, "%s", db_get_string(&sql));
- 
- 	if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	    db_close_database_shutdown_driver(driver);
-diff --git a/vector/v.net.timetable/main.c b/vector/v.net.timetable/main.c
-index dc5acdc..f979c2f 100644
---- a/vector/v.net.timetable/main.c
-+++ b/vector/v.net.timetable/main.c
-@@ -96,7 +96,7 @@ void init_database(struct Map_info *Out, dbDriver ** driver,
-     sprintf(buf, "create table %s (%s)", (*Fi)->table, columns);
- 
-     db_set_string(&sql, buf);
--    G_debug(2, db_get_string(&sql));
-+    G_debug(2, "%s", db_get_string(&sql));
- 
-     if (db_execute_immediate(*driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(*driver);
-@@ -128,7 +128,7 @@ void insert_point(dbDriver * driver, char *table, int cat, int path,
-     sprintf(buf, "insert into %s values (%d, %d, %d, %d, %d, %d)", table, cat,
- 	    path, stop_id, index, arrival_time, departure_time);
-     db_set_string(&sql, buf);
--    G_debug(3, db_get_string(&sql));
-+    G_debug(3, "%s", db_get_string(&sql));
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
- 	G_fatal_error(_("Cannot insert new record: %s"), db_get_string(&sql));
-@@ -150,7 +150,7 @@ void insert_line(dbDriver * driver, char *table, int cat, int path,
- 	    table, cat, path, from_id, to_id, route_id, index, from_time,
- 	    to_time);
-     db_set_string(&sql, buf);
--    G_debug(3, db_get_string(&sql));
-+    G_debug(3, "%s", db_get_string(&sql));
-     if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	db_close_database_shutdown_driver(driver);
- 	G_fatal_error(_("Cannot insert new record: %s"), db_get_string(&sql));
-diff --git a/vector/v.overlay/area_area.c b/vector/v.overlay/area_area.c
-index e8f4382..da6f02f 100644
---- a/vector/v.overlay/area_area.c
-+++ b/vector/v.overlay/area_area.c
-@@ -339,7 +339,7 @@ int area_area(struct Map_info *In, int *field, struct Map_info *Out,
- 
- 			db_append_string(&stmt, " )");
- 
--			G_debug(3, db_get_string(&stmt));
-+			G_debug(3, "%s", db_get_string(&stmt));
- 
- 			if (db_execute_immediate(driver, &stmt) != DB_OK)
- 			    G_warning(_("Unable to insert new record: '%s'"),
-diff --git a/vector/v.overlay/line_area.c b/vector/v.overlay/line_area.c
-index 3b35138..92e0560 100644
---- a/vector/v.overlay/line_area.c
-+++ b/vector/v.overlay/line_area.c
-@@ -212,7 +212,7 @@ int line_area(struct Map_info *In, int *field, struct Map_info *Out,
- 
- 			    db_append_string(&stmt, " )");
- 
--			    G_debug(3, db_get_string(&stmt));
-+			    G_debug(3, "%s", db_get_string(&stmt));
- 
- 			    if (db_execute_immediate(driver, &stmt) != DB_OK)
- 				G_warning(_("Unable to insert new record: '%s'"),
-diff --git a/vector/v.overlay/main.c b/vector/v.overlay/main.c
-index ea87580..a6ab830 100644
---- a/vector/v.overlay/main.c
-+++ b/vector/v.overlay/main.c
-@@ -517,7 +517,7 @@ int main(int argc, char *argv[])
- 
- 	db_append_string(&stmt, " )");
- 
--	G_debug(3, db_get_string(&stmt));
-+	G_debug(3, "%s", db_get_string(&stmt));
- 
- 	if (db_execute_immediate(driver, &stmt) != DB_OK) {
- 	    Vect_close(&Out);
-diff --git a/vector/v.random/main.c b/vector/v.random/main.c
-index e68ffbd..08b38ac 100644
---- a/vector/v.random/main.c
-+++ b/vector/v.random/main.c
-@@ -185,7 +185,7 @@ int main(int argc, char *argv[])
- 			    Fi->driver);
- 
- 	/* Create table */
--	G_debug(3, db_get_string(&sql));
-+	G_debug(3, "%s", db_get_string(&sql));
- 	if (db_execute_immediate(driver, &sql) != DB_OK) {
- 	    db_close_database(driver);
- 	    db_shutdown_driver(driver);
-@@ -292,7 +292,7 @@ int main(int argc, char *argv[])
- 		sprintf(buf, "%.0f )", z);
- 	    db_append_string(&sql, buf);
- 
--	    G_debug(3, db_get_string(&sql));
-+	    G_debug(3, "%s", db_get_string(&sql));
- 	    if (db_execute_immediate(driver, &sql) != DB_OK) {
- 		db_close_database(driver);
- 		db_shutdown_driver(driver);
-diff --git a/vector/v.surf.rst/main.c b/vector/v.surf.rst/main.c
-index 88dfdd0..a21db40 100644
---- a/vector/v.surf.rst/main.c
-+++ b/vector/v.surf.rst/main.c
-@@ -601,7 +601,7 @@ int main(int argc, char *argv[])
- 	db_append_string(&sql2, "cat integer");
- 	db_append_string(&sql2, ", flt1 double precision");
- 	db_append_string(&sql2, ")");
--	G_debug(1, db_get_string(&sql2));
-+	G_debug(1, "%s", db_get_string(&sql2));
- 	driver2 = db_start_driver_open_database(ff->driver, ff->database);
- 	if (driver2 == NULL)
- 	    G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
-@@ -920,5 +920,5 @@ void clean_fatal_error(char *str)
- 	fclose(Tmp_fd_xy);
- 	unlink(Tmp_file_xy);
-     }
--    G_fatal_error(str);
-+    G_fatal_error("%s", str);
- }
-diff --git a/vector/v.vol.rst/main.c b/vector/v.vol.rst/main.c
-index 2d25b4e..ff7cc5e 100644
---- a/vector/v.vol.rst/main.c
-+++ b/vector/v.vol.rst/main.c
-@@ -584,7 +584,7 @@ int main(int argc, char *argv[])
- 	db_append_string(&sql, "cat integer");
- 	db_append_string(&sql, ", flt1 double precision");
- 	db_append_string(&sql, ")");
--	G_debug(1, db_get_string(&sql));
-+	G_debug(1, "%s", db_get_string(&sql));
- 	driver = db_start_driver_open_database(f->driver, f->database);
- 	if (driver == NULL)
- 	    G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
-diff --git a/vector/v.vol.rst/user4.c b/vector/v.vol.rst/user4.c
-index 3ff3fbf..8067f44 100644
---- a/vector/v.vol.rst/user4.c
-+++ b/vector/v.vol.rst/user4.c
-@@ -74,7 +74,7 @@ void clean_fatal_error(char *str)
- 	fclose(Tmp_fd_xy);
- 	unlink(Tmp_file_xy);
<Skipped 85 lines>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/grass.git/commitdiff/91be88b5cf0b64f6d801d5d1f250a0edc913dac4




More information about the pld-cvs-commit mailing list