summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2016-01-15 12:33:18 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-01-15 12:33:18 (GMT)
commitc90ba2a863a446b51b9ee960cead69a4b2884045 (patch) (side-by-side diff)
treea6c36a8a15fd00f49dd3b0b46ca619563571e1f0
parent746f6355a4595cc4bbcffc89a3e42a082d757759 (diff)
downloadvmod-variable-c90ba2a863a446b51b9ee960cead69a4b2884045.tar.gz
vmod-variable-c90ba2a863a446b51b9ee960cead69a4b2884045.tar.bz2
Minor fixes.
Remove unused variables, shut gcc warnings. * src/variable.c (get_symtab): Bail out if cache fd is less than 0.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/variable.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/variable.c b/src/variable.c
index bd79c3b..e6bad1a 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -387,4 +387,6 @@ get_symtab(VARIABLE_CTX ctx)
struct symtab *st;
int fd = ctx->req->sp->fd;
+
+ assert(fd >= 0);
AZ(pthread_mutex_lock(&symtab_mtx));
if (symtabc <= fd) {
@@ -729,5 +731,4 @@ vmod_regset(VARIABLE_CTX ctx, VCL_STRING vars, VCL_STRING rxs,
int cflags = 0;
union value value;
- char *p;
int ovsize;
int *ovector;
@@ -863,5 +864,5 @@ xdecode(char *s)
for (s = d; *s; ) {
if (*s == '%' && hex2ul(s[1]) != -1 && hex2ul(s[2]) != -1) {
- *d++ = hex2ul(s[1]) << 4 + hex2ul(s[2]);
+ *d++ = (hex2ul(s[1]) << 4) + hex2ul(s[2]);
s += 3;
} else
@@ -899,5 +900,4 @@ vmod_queryset(VARIABLE_CTX ctx, VCL_STRING vars, VCL_STRING query)
struct vardef *head = NULL, *tail = NULL, *def;
size_t count = 0;
- size_t n;
const char *v = vars;
@@ -964,5 +964,5 @@ vmod_queryset(VARIABLE_CTX ctx, VCL_STRING vars, VCL_STRING query)
NULL, 0);
define_param(vt, def, valptr, vallen);
- free(def);
+ vardef_free(def);
}
}

Return to:

Send suggestions and report system problems to the System administrator.