瀏覽代碼

avoid 'format not a string literal and no format arguments' warnings (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@57358 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 11 年之前
父節點
當前提交
e7bf57d3d1
共有 1 個文件被更改,包括 5 次插入9 次删除
  1. 5 9
      display/d.colors/get_info.c

+ 5 - 9
display/d.colors/get_info.c

@@ -3,13 +3,13 @@
 #include <grass/gis.h>
 #include <grass/display.h>
 #include <grass/colors.h>
+#include <grass/glocale.h>
 #include "colors.h"
 
 int get_map_info(char *name, char *mapset)
 {
     struct Colors colors;
     struct Categories categories;
-    char buff[128];
 
     if (!name)
 	exit(0);
@@ -17,16 +17,12 @@ int get_map_info(char *name, char *mapset)
 	exit(0);
 
     /* Reading color lookup table */
-    if (Rast_read_cats(name, mapset, &categories) == -1) {
-	sprintf(buff, "category file for [%s] not available", name);
-	G_fatal_error(buff);
-    }
+    if (Rast_read_cats(name, mapset, &categories) == -1)
+	G_fatal_error(_("Error reading category file for <%s>"), name);
 
     /* Reading color lookup table */
-    if (Rast_read_colors(name, mapset, &colors) == -1) {
-	sprintf(buff, "color file for [%s] not available", name);
-	G_fatal_error(buff);
-    }
+    if (Rast_read_colors(name, mapset, &colors) == -1)
+	G_fatal_error(_("Unable to read color table for raster map <%s>"), name);
 
     interact(&categories, &colors, name, mapset);