浏览代码

libgmath: fix incorrect memset of double array (#2005)

Addresses a -Wsizeof-pointer-memaccess compiler warning.
nilason 3 年之前
父节点
当前提交
2808fe4f96
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/gmath/la.c

+ 1 - 1
lib/gmath/la.c

@@ -90,7 +90,7 @@ int G_matrix_zero(mat_struct * A)
     if (!A->vals)
 	return 0;
 
-    memset(A->vals, 0, sizeof(A->vals));
+    memset(A->vals, 0, (A->ldim * A->cols) * sizeof(doublereal));
 
     return 1;
 }