summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2017-02-28 07:12:28 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2017-02-28 07:12:28 (GMT)
commit6639d5376f5d94f48ba753544adeeb958cef0590 (patch) (side-by-side diff)
tree5b365fbd6049034728c7800e3b1cc3f245888ee7
parentfc751813fb586ab38d712843f610eb175656e66a (diff)
downloadjumper-6639d5376f5d94f48ba753544adeeb958cef0590.tar.gz
jumper-6639d5376f5d94f48ba753544adeeb958cef0590.tar.bz2
Minor fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/listener.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/listener.c b/src/listener.c
index 2960dab..230205b 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -295,7 +295,7 @@ listener_kve_init(char **kve, int kvn, listener_t *lp, ...)
int i = 0;
static char linebuf[64];
va_list ap;
- char *p;
+ char *kw, *val;
if (kvn < KVE_MINSIZE) {
diag(LOG_CRIT, "%s:%d: INTERNAL ERROR", __FILE__, __LINE__);
@@ -313,14 +313,14 @@ listener_kve_init(char **kve, int kvn, listener_t *lp, ...)
kve[i++] = linebuf;
va_start(ap, lp);
- while ((p = va_arg(ap,char*))) {
- if (i == kvn) {
+ while ((kw = va_arg(ap,char*)) && (val = va_arg(ap,char*))) {
+ if (i + 2 >= kvn) {
diag(LOG_CRIT, "%s:%d: INTERNAL ERROR",
__FILE__, __LINE__);
abort();
}
- if (p)
- kve[i++] = p;
+ kve[i++] = kw;
+ kve[i++] = val;
}
va_end(ap);
kve[i] = NULL;
@@ -477,7 +477,7 @@ listener_print_status(listener_t *lp)
static int
runaction(listener_t *lp, action_t *act, event_t *evt)
{
- char *kve[KVE_MINSIZE + 7];
+ char *kve[KVE_MINSIZE + 8];
char codebuf[64];
char statbuf[64];
char pidbuf[80], *pid;

Return to:

Send suggestions and report system problems to the System administrator.