From 7b5c69f9935d47038e42431a5efbf87568a879fe Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 30 Jan 2019 20:54:25 +0100 Subject: [PATCH] fix maxsegmentindex being off by one --- libsrc/geom2d/genmesh2d.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/geom2d/genmesh2d.cpp b/libsrc/geom2d/genmesh2d.cpp index 43193e3a..b42440ce 100644 --- a/libsrc/geom2d/genmesh2d.cpp +++ b/libsrc/geom2d/genmesh2d.cpp @@ -457,9 +457,9 @@ namespace netgen for (SegmentIndex si = 0; si < mesh->GetNSeg(); si++) if ( (*mesh)[si].si > maxsegmentindex) maxsegmentindex = (*mesh)[si].si; - mesh->SetNBCNames(maxsegmentindex+1); + mesh->SetNBCNames(maxsegmentindex); - for ( int sindex = 0; sindex <= maxsegmentindex; sindex++ ) + for ( int sindex = 0; sindex < maxsegmentindex; sindex++ ) mesh->SetBCName ( sindex, geometry.GetBCName( sindex+1 ) ); for (SegmentIndex si = 0; si < mesh->GetNSeg(); si++)