From ee0cdcd908089b8ec87ead5961362e2daec7d250 Mon Sep 17 00:00:00 2001 From: Yasuhiro Ohara Date: Sun, 23 Jun 2024 16:56:24 +0900 Subject: [PATCH] modern compiler does not allow strncpy() of the same size as the destination buffer. --- src/lthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lthread.c b/src/lthread.c index 7209906..b874da9 100644 --- a/src/lthread.c +++ b/src/lthread.c @@ -531,7 +531,7 @@ void lthread_set_funcname(const char *f) { struct lthread *lt = lthread_get_sched()->current_lthread; - strncpy(lt->funcname, f, 64); + strncpy(lt->funcname, f, sizeof (lt->funcname) - 1); } uint64_t