You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xneur/SOURCES/xneur-memset.patch

16 lines
479 B

diff --git a/xneur/lib/misc/text.c b/xneur/lib/misc/text.c
index 9ab75c2..f809c9d 100644
--- a/xneur/lib/misc/text.c
+++ b/xneur/lib/misc/text.c
@@ -285,9 +285,7 @@ int levenshtein(const char *s, const char *t)
int ls = strlen(s), lt = strlen(t);
int d[ls + 1][lt + 1];
- for (int i = 0; i <= ls; i++)
- for (int j = 0; j <= lt; j++)
- d[i][j] = -1;
+ memset(d, -1, sizeof(int) * (ls + 1) * (lt + 1));
int dist(int i, int j) {
if (d[i][j] >= 0) return d[i][j];