Browse Source

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

Addresses a -Wsizeof-pointer-memaccess compiler warning.
nilason 3 years ago
parent
commit
2808fe4f96
1 changed files with 1 additions and 1 deletions
  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;
 }