aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2007-09-05 03:46:41 +0000
committerJason Woodward2007-09-05 03:46:41 +0000
commitc6ad9c938df89430c5e1753565fcadb654dcef72 (patch)
treec237c0ea787fb5a899bdefd36ef709258de14ae6 /src
parent4f09813d20ad01fda9bc6f903058eb2aa82d2449 (diff)
downloadslapt-get-c6ad9c938df89430c5e1753565fcadb654dcef72.tar.gz
correct regex creation for reverse dep lookup
Diffstat (limited to 'src')
-rw-r--r--src/package.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/package.c b/src/package.c
index 1fca709..51933f5 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1890,13 +1890,13 @@ static void required_by(struct slapt_pkg_list *avail,
unsigned int i;
slapt_regex_t *required_by_reg = NULL;
char *pkg_name = escape_package_name(pkg);
- int reg_str_len = strlen(pkg_name) + 3;
+ int reg_str_len = strlen(pkg_name) + 5;
char *reg = slapt_malloc(sizeof *reg * reg_str_len);
/* add word boundary to search */
int sprintf_r = snprintf(reg, (size_t)reg_str_len, "\\W%s\\W", pkg_name);
- if (sprintf_r < reg_str_len) {
- fprintf(stderr,"sprintf error for %s: %d < %d\n", pkg_name, sprintf_r, reg_str_len);
+ if (sprintf_r < 0) {
+ fprintf(stderr,"sprintf error for %s\n", pkg_name);
exit(EXIT_FAILURE);
}