From 5423242cd860392d9e6259847cde34caf8e5a580 Mon Sep 17 00:00:00 2001 From: Lukas Kogler Date: Tue, 16 Apr 2019 16:04:22 +0200 Subject: [PATCH] fix uninitialized values --- libsrc/general/array.hpp | 3 +-- libsrc/meshing/parallelmesh.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libsrc/general/array.hpp b/libsrc/general/array.hpp index df0cd0a5..07ec23d7 100644 --- a/libsrc/general/array.hpp +++ b/libsrc/general/array.hpp @@ -246,8 +246,7 @@ namespace netgen : FlatArray (asize, asize ? new T[asize] : nullptr) { allocsize = asize; - if(asize) - ownmem = 1; + ownmem = (asize == 0) ? 0 : 1; } /// Generate array in user data diff --git a/libsrc/meshing/parallelmesh.cpp b/libsrc/meshing/parallelmesh.cpp index 45d6f98b..0843ecda 100644 --- a/libsrc/meshing/parallelmesh.cpp +++ b/libsrc/meshing/parallelmesh.cpp @@ -873,7 +873,7 @@ namespace netgen *testout << "got " << numvert << " vertices" << endl; { - Element el; + Element el(dim==2 ? 3 : 4); Array elarray; MyMPI_Recv (elarray, 0, MPI_TAG_MESH+2, comm);