[GRASS-SVN] r43541 - grass/trunk/general/g.message
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Sep 20 15:18:52 EDT 2010
Author: glynn
Date: 2010-09-20 19:18:52 +0000 (Mon, 20 Sep 2010)
New Revision: 43541
Modified:
grass/trunk/general/g.message/main.c
Log:
Don't treat message as a format string (bug #1162)
Modified: grass/trunk/general/g.message/main.c
===================================================================
--- grass/trunk/general/g.message/main.c 2010-09-20 17:04:26 UTC (rev 43540)
+++ grass/trunk/general/g.message/main.c 2010-09-20 19:18:52 UTC (rev 43541)
@@ -86,7 +86,6 @@
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
-
if (fatal->answer + warning->answer + debug_flag->answer +
verbose->answer > 1)
G_fatal_error(_("Select only one message level"));
@@ -94,9 +93,9 @@
debug_level = atoi(debug_opt->answer);
if (fatal->answer)
- G_fatal_error(message->answer);
+ G_fatal_error("%s", message->answer);
else if (warning->answer)
- G_warning(message->answer);
+ G_warning("%s", message->answer);
else if (percent->answer) {
int i, n, s;
i = n = s = -1;
@@ -107,13 +106,13 @@
fprintf(stderr, "\n");
}
else if (debug_flag->answer)
- G_debug(debug_level, message->answer);
+ G_debug(debug_level, "%s", message->answer);
else if (important->answer)
- G_important_message(message->answer);
+ G_important_message("%s", message->answer);
else if (verbose->answer)
- G_verbose_message(message->answer);
+ G_verbose_message("%s", message->answer);
else
- G_message(message->answer);
+ G_message("%s", message->answer);
exit(EXIT_SUCCESS);
}
More information about the grass-commit
mailing list