Fix GCC 9 string trunction warning

- Increase size of resulting path buffer, unlikely a real problem
- Check return value from snprintf() to detect errors and truncation
- Add logit() function wrapper to initctl, maps to _e()/_d()/_pe()

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2020-01-07 01:03:57 +01:00
parent 744719219e
commit 8d271ac5b8
5 changed files with 22 additions and 6 deletions
+13
View File
@@ -688,6 +688,19 @@ int main(int argc, char *argv[])
return usage(1);
}
void logit(int prio, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
if (prio <= LOG_ERR)
verrx(1, fmt, ap);
else
vwarnx(fmt, ap);
va_end(ap);
}
/**
* Local Variables:
* indent-tabs-mode: t