From c282663a96ae9704a59c55c9300dbc8c49e0ef39 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Mon, 18 Nov 2019 09:41:22 -0800 Subject: Add sanity checks for overwriting buffers --- Source/Randomizer2Core.cpp | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'Source/Randomizer2Core.cpp') diff --git a/Source/Randomizer2Core.cpp b/Source/Randomizer2Core.cpp index 8bd5765..0310ae2 100644 --- a/Source/Randomizer2Core.cpp +++ b/Source/Randomizer2Core.cpp @@ -6,31 +6,19 @@ #include #include -// @Cutnpaste -std::vector Randomizer2Core::CutEdges(const Puzzle& p, size_t numEdges) { +std::vector Randomizer2Core::CutEdges(const Puzzle& p, size_t numEdges, bool allowEdges) { std::vector edges; - for (int x=0; x Randomizer2Core::CutEdges2(const Puzzle& p, size_t numEdges) { - std::vector edges; - // Note the iterator bounds; we skip the outer edges. - for (int x=1; x