[GRASS-SVN] r74444 - grass/trunk/raster/r.thin

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 1 13:10:09 PDT 2019


Author: mmetz
Date: 2019-05-01 13:10:09 -0700 (Wed, 01 May 2019)
New Revision: 74444

Modified:
   grass/trunk/raster/r.thin/local_proto.h
   grass/trunk/raster/r.thin/thin_lines.c
Log:
r.thin: avoid integer overflow, continued

Modified: grass/trunk/raster/r.thin/local_proto.h
===================================================================
--- grass/trunk/raster/r.thin/local_proto.h	2019-04-30 18:28:34 UTC (rev 74443)
+++ grass/trunk/raster/r.thin/local_proto.h	2019-05-01 20:10:09 UTC (rev 74444)
@@ -11,4 +11,4 @@
 
 /* thin_lines.c */
 int thin_lines(int);
-char encode_neighbours(CELL *, CELL *, CELL *, int, int);
+unsigned char encode_neighbours(CELL *, CELL *, CELL *, int, int);

Modified: grass/trunk/raster/r.thin/thin_lines.c
===================================================================
--- grass/trunk/raster/r.thin/thin_lines.c	2019-04-30 18:28:34 UTC (rev 74443)
+++ grass/trunk/raster/r.thin/thin_lines.c	2019-05-01 20:10:09 UTC (rev 74444)
@@ -36,8 +36,7 @@
 {
     int j, i, col, deleted, row;
     CELL *row_buf, *new_med, *med, *bottom, *top, *get_a_row();
-    char W, N_W;
-    unsigned char Templ[8], N_Templ[8];
+    unsigned char W, N_W, Templ[8], N_Templ[8];
 
     map_size(&n_rows, &n_cols, &pad_size);
     box_right = box_bottom = 0;
@@ -183,7 +182,7 @@
  * 3 4 5
  */
 
-char
+unsigned char
 encode_neighbours(CELL * top, CELL * middle, CELL * bottom, int col, int neg)
 {
     char T;



More information about the grass-commit mailing list