aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/package.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/package.c b/src/package.c
index a77881f..6ffe8bb 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1482,8 +1482,10 @@ static slapt_pkg_info_t *parse_meta_entry(slapt_pkg_list_t *avail_pkgs,
return NULL;
}
- strcpy(tmp_pkg_cond, dep_entry + parse_dep_regex->pmatch[2].rm_so);
- tmp_pkg_cond[tmp_cond_len] = '\0';
+ if (tmp_cond_len != 0) {
+ strcpy(tmp_pkg_cond, dep_entry + parse_dep_regex->pmatch[2].rm_so);
+ tmp_pkg_cond[tmp_cond_len] = '\0';
+ }
tmp_pkg_ver = slapt_regex_extract_match(parse_dep_regex, dep_entry, 3);