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) (unidiff)
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, ...)
295 int i = 0; 295 int i = 0;
296 static char linebuf[64]; 296 static char linebuf[64];
297 va_list ap; 297 va_list ap;
298 char *p; 298 char *kw, *val;
299 299
300 if (kvn < KVE_MINSIZE) { 300 if (kvn < KVE_MINSIZE) {
301 diag(LOG_CRIT, "%s:%d: INTERNAL ERROR", __FILE__, __LINE__); 301 diag(LOG_CRIT, "%s:%d: INTERNAL ERROR", __FILE__, __LINE__);
@@ -313,14 +313,14 @@ listener_kve_init(char **kve, int kvn, listener_t *lp, ...)
313 kve[i++] = linebuf; 313 kve[i++] = linebuf;
314 314
315 va_start(ap, lp); 315 va_start(ap, lp);
316 while ((p = va_arg(ap,char*))) { 316 while ((kw = va_arg(ap,char*)) && (val = va_arg(ap,char*))) {
317 if (i == kvn) { 317 if (i + 2 >= kvn) {
318 diag(LOG_CRIT, "%s:%d: INTERNAL ERROR", 318 diag(LOG_CRIT, "%s:%d: INTERNAL ERROR",
319 __FILE__, __LINE__); 319 __FILE__, __LINE__);
320 abort(); 320 abort();
321 } 321 }
322 if (p) 322 kve[i++] = kw;
323 kve[i++] = p; 323 kve[i++] = val;
324 } 324 }
325 va_end(ap); 325 va_end(ap);
326 kve[i] = NULL; 326 kve[i] = NULL;
@@ -477,7 +477,7 @@ listener_print_status(listener_t *lp)
477static int 477static int
478runaction(listener_t *lp, action_t *act, event_t *evt) 478runaction(listener_t *lp, action_t *act, event_t *evt)
479{ 479{
480 char *kve[KVE_MINSIZE + 7]; 480 char *kve[KVE_MINSIZE + 8];
481 char codebuf[64]; 481 char codebuf[64];
482 char statbuf[64]; 482 char statbuf[64];
483 char pidbuf[80], *pid; 483 char pidbuf[80], *pid;

Return to:

Send suggestions and report system problems to the System administrator.