mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user