Browse Source

r.what: fix qsort cmp fn (see https://trac.osgeo.org/grass/ticket/3564)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73136 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 6 years ago
parent
commit
db2005c002
1 changed files with 3 additions and 1 deletions
  1. 3 1
      raster/r.what/main.c

+ 3 - 1
raster/r.what/main.c

@@ -562,7 +562,9 @@ static int by_row(const void *ii, const void *jj)
 {
 {
     const struct order *i = ii, *j = jj;
     const struct order *i = ii, *j = jj;
 
 
-    return i->row - j->row;
+    if (i->row < j->row)
+	return -1;
+    return (i->row > j->row);
 }
 }