From d37b19aaaab0c28f4d1e4ae0690c73c0031a027b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 18 Mar 2021 23:08:08 +0100 Subject: [PATCH] gcc: ensure buffer ends with 0 --- lib/commands/toolcontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 92008a641..75634caff 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -230,7 +230,7 @@ static void _get_sysfs_dir(struct cmd_context *cmd, char *buf, size_t buf_size) return; } - strncpy(buf, sys_mnt, buf_size); + (void) dm_strncpy(buf, sys_mnt, buf_size); } static uint32_t _parse_debug_fields(struct cmd_context *cmd, int cfg, const char *cfgname)