Minor refactor, reuse MATCH_CMD() from conf.c in service_register()

When adding a new service option recently, I copy-pasted and forgot to
update the length argument to strncasecmp(), so it was time to fix that
once and for all.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-06-12 23:13:50 +02:00
1 parent 561c88a868
commit 4a8ca787d3
3 files changed
+38 -34

No files matched your search

+3
View File
@@ -29,6 +29,9 @@
#include "plugin.h"
#define SERVICE_INTERVAL_DEFAULT 300000 /* 5 mins */
#define MATCH_CMD(l, c, x) \
(!strncasecmp(l, c, strlen(c)) && (x = (l) + strlen(c)))
extern int service_interval;
int api_init (uev_ctx_t *ctx);