15 changes: 13 additions & 2 deletions foma/lexcread.c
Expand Up @@ -506,8 +506,12 @@ void lexc_medpad() {
for (i = 0; cwordout[i] != -1; i++) { }
s2len = i;

int matrix[s1len+2][s2len+2];
int dirmatrix[s1len+2][s2len+2];
int **matrix = calloc(s1len + 2, sizeof(int*));
int** dirmatrix = calloc(s1len + 2, sizeof(int*));
for (size_t i = 0; i < s1len + 2; ++i) {
matrix[i] = calloc(s2len + 2, sizeof(int));
dirmatrix[i] = calloc(s2len + 2, sizeof(int));
}

matrix[0][0] = 0;
dirmatrix[0][0] = 0;
Expand Down Expand Up @@ -562,6 +566,13 @@ void lexc_medpad() {
}
cwordin[j] = -1;
cwordout[j] = -1;

for (size_t i = 0; i < s1len + 2; ++i) {
free(matrix[i]);
free(dirmatrix[i]);
}
free(matrix);
free(dirmatrix);
}

void lexc_pad() {
Expand Down
10 changes: 10 additions & 0 deletions foma/libfoma.pc.in
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: foma
Description: The foma library
Version: @PROJECT_VERSION@
Cflags: -I${includedir}/
Libs: Libs: -L${libdir} -lfoma
1 change: 0 additions & 1 deletion foma/structures.c
Expand Up @@ -18,7 +18,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include "foma.h"

static struct defined_quantifiers *quantifiers;
Expand Down