浏览代码

Vlib: add comment to qsort cmp fn (see https://trac.osgeo.org/grass/ticket/3564)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73140 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 6 年之前
父节点
当前提交
caf1a33971
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      lib/vector/Vlib/break_lines.c

+ 3 - 1
lib/vector/Vlib/break_lines.c

@@ -110,7 +110,9 @@ static int cmp(const void *a, const void *b)
 {
     int ai = *(int *)a;
     int bi = *(int *)b;
-    
+
+    /* ai - bi is ok because ai and bi are positive integers
+     * -> no integer overflow */
     return (ai - bi);
 }