summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regex.c2
-rw-r--r--src/tables.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/regex.c b/src/regex.c
index b44d958..2eacacc 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -82,7 +82,7 @@ char *regmatch_dup (regmatch_t * m, const char *src)
char *str;
size_t len;
- if (m == NULL || m->rm_so < 0)
+ if (m == NULL || m->rm_so < 0 || m->rm_eo < m->rm_so)
return NULL;
len = (size_t) (m->rm_eo - m->rm_so);
str = malloc((len + 1) * sizeof(char));
diff --git a/src/tables.c b/src/tables.c
index 30828a6..980d2e9 100644
--- a/src/tables.c
+++ b/src/tables.c
@@ -437,7 +437,7 @@ static size_t min_int_size (struct yytbl_data *tbl)
n = abs (yytbl_data_geti (tbl, i));
- if (n > max)
+ if (max < n)
max = n;
}