From ab463540831ef670069709e000313249a7418540 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 14 Apr 2019 19:23:30 +0200 Subject: [PATCH 1/2] fix whitespaces / code-style --- lib/nodes/test_rtt.cpp | 4 ++-- lib/path_source.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nodes/test_rtt.cpp b/lib/nodes/test_rtt.cpp index f969db2d2..4d19ea396 100644 --- a/lib/nodes/test_rtt.cpp +++ b/lib/nodes/test_rtt.cpp @@ -101,7 +101,7 @@ int test_rtt_prepare(struct node *n) max_values = c->values; c->filename_formatted = (char *) alloc(NAME_MAX); - + strftime(c->filename_formatted, NAME_MAX, c->filename, &tm); } @@ -392,7 +392,7 @@ int test_rtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned if ((unsigned) t->counter >= c->limit) { info("Stopping case #%d", t->current); - + t->counter = -1; if (t->cooldown) { diff --git a/lib/path_source.cpp b/lib/path_source.cpp index d65649cfd..a306c2a92 100644 --- a/lib/path_source.cpp +++ b/lib/path_source.cpp @@ -151,7 +151,7 @@ int path_source_read(struct path_source *ps, struct path *p, int i) #endif if (p->mask.test(i)) { - /* Check if we received an update from all nodes/ */ + /* Check if we received an update from all nodes */ if ((p->mode == PATH_MODE_ANY) || (p->mode == PATH_MODE_ALL && p->mask == p->received)) { path_destination_enqueue(p, muxed_smps, toenqueue); From ed56993302e589d5d06f61c95743dd6b2e079326 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 14 Apr 2019 19:26:41 +0200 Subject: [PATCH 2/2] web: fix out-of-bounds access if compiled with -DWITH_API=OFF (thanks Sonja) --- lib/web.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web.cpp b/lib/web.cpp index 955c19f1c..12351b028 100644 --- a/lib/web.cpp +++ b/lib/web.cpp @@ -259,7 +259,7 @@ void Web::start() logger->info("Starting sub-system: htdocs={}", htdocs.c_str()); /* update web root of mount point */ - mounts[1].origin = htdocs.c_str(); + mounts[ARRAY_LEN(mounts)-1].origin = htdocs.c_str(); context = lws_create_context(&ctx_info); if (context == nullptr)