From cca2b08321fa1cf788adfaa070416c4c29bc1e22 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 5 Jan 2015 18:58:28 -0500 Subject: [PATCH] Replaced dynamic array initialization with vector. --- src/openalpr/utility.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/openalpr/utility.cpp b/src/openalpr/utility.cpp index 6cef65b..66e5b26 100644 --- a/src/openalpr/utility.cpp +++ b/src/openalpr/utility.cpp @@ -276,7 +276,15 @@ int levenshteinDistance (const std::string &s1, const std::string &s2, int max) int len2 = s2.length(); max--; - int matrix[2][len2 + 1]; + //int matrix[2][len2 + 1]; + std::vector > matrix; + for (unsigned int i = 0; i < 2; i++) + { + std::vector top_elem; + matrix.push_back(top_elem); + for (unsigned int j = 0; j < len2 + 1; j++) + matrix[i].push_back(0); + } int i; int j;