mirror of
https://github.com/troglobit/finit.git
synced 2026-10-09 16:50:59 +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:
+2
-2
@@ -50,11 +50,11 @@ const char *condstr(enum cond_state s)
|
||||
const char *cond_path(const char *name)
|
||||
{
|
||||
char tmp[MAX_ARG_LEN];
|
||||
static char file[MAX_ARG_LEN];
|
||||
static char path[256];
|
||||
|
||||
snprintf(tmp, sizeof(tmp), COND_PATH "/%s", name);
|
||||
|
||||
return pid_runpath(tmp, file, sizeof(file));
|
||||
return pid_runpath(tmp, path, sizeof(path));
|
||||
}
|
||||
|
||||
unsigned int cond_get_gen(const char *file)
|
||||
|
||||
Reference in New Issue
Block a user