Fix printf format specifier and formatting issues in use of log fns

Almost all related to and (less likely) possible causes of issue #236.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-04-14 00:26:14 +02:00
1 parent 6d58c9ed0b
commit a0820c7f20
3 files changed
+6 -5

No files matched your search

+2 -1
View File
@@ -1,3 +1,4 @@
/* Netlink plugin for IFUP/IFDN and GW events /* Netlink plugin for IFUP/IFDN and GW events
* *
* Copyright (C) 2009-2011 Mårten Wikström <marten.wikstrom@keystream.se> * Copyright (C) 2009-2011 Mårten Wikström <marten.wikstrom@keystream.se>
@@ -252,7 +253,7 @@ static int nl_parse(int sd)
return -1; return -1;
} }
_d("recv %lld bytes", len); _d("recv %zd bytes", len);
l = (size_t)len; l = (size_t)len;
for (nh = (struct nlmsghdr *)nl_buf; NLMSG_OK(nh, l); nh = NLMSG_NEXT(nh, l)) { for (nh = (struct nlmsghdr *)nl_buf; NLMSG_OK(nh, l); nh = NLMSG_NEXT(nh, l)) {
struct nlmsgerr *nle; struct nlmsgerr *nle;
+1 -1
View File
@@ -526,7 +526,7 @@ void cgroup_init(uev_ctx_t *ctx)
/* Move ourselves to init (best effort, otherwise run in 'root' group */ /* Move ourselves to init (best effort, otherwise run in 'root' group */
if (fnwrite("1", FINIT_CGPATH "/init/cgroup.procs")) { if (fnwrite("1", FINIT_CGPATH "/init/cgroup.procs")) {
_pe("Failed moving PID 1 to cgroup ", FINIT_CGPATH "/init"); _pe("Failed moving PID 1 to cgroup %s", FINIT_CGPATH "/init");
uev_io_stop(&cgw); uev_io_stop(&cgw);
iwatch_exit(&iw_cgroup); iwatch_exit(&iw_cgroup);
close(fd); close(fd);
+3 -3
View File
@@ -558,7 +558,7 @@ static int service_start(svc_t *svc)
for (i = 0; i < we.we_wordc; i++) { for (i = 0; i < we.we_wordc; i++) {
if (strlen(we.we_wordv[i]) >= sizeof(svc->args[i])) { if (strlen(we.we_wordv[i]) >= sizeof(svc->args[i])) {
logit(LOG_ERR, "%s: expanded arg. '%s' too long", we.we_wordv[i]); logit(LOG_ERR, "%s: expanded arg. '%s' too long", svc->cmd, we.we_wordv[i]);
rc = WRDE_NOSPACE; rc = WRDE_NOSPACE;
goto nomem; goto nomem;
} }
@@ -931,7 +931,7 @@ static void parse_env(svc_t *svc, char *env)
return; return;
if (strlen(env) >= sizeof(svc->env)) { if (strlen(env) >= sizeof(svc->env)) {
_e("%s: env file is too long (>%d chars)", svc->cmd, sizeof(svc->env)); _e("%s: env file is too long (>%zu chars)", svc->cmd, sizeof(svc->env));
return; return;
} }
@@ -955,7 +955,7 @@ static void parse_cgroup(svc_t *svc, char *cgroup)
} }
if (strlen(ptr) >= sizeof(svc->cgroup)) { if (strlen(ptr) >= sizeof(svc->cgroup)) {
_e("%s: cgroup settings too long (>%d chars)", svc->cmd, sizeof(svc->cgroup)); _e("%s: cgroup settings too long (>%zu chars)", svc->cmd, sizeof(svc->cgroup));
return; return;
} }