From 967e965d2373c68d59a1e757fb3c359da264c160 Mon Sep 17 00:00:00 2001 From: Bertho Stultiens Date: Mon, 19 Jan 2026 16:02:43 +0100 Subject: [PATCH] Fix strncat warning by using local small buffer. --- src/emc/tooldata/tooldata_common.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/emc/tooldata/tooldata_common.cc b/src/emc/tooldata/tooldata_common.cc index 127600ff655..a6fea970be0 100644 --- a/src/emc/tooldata/tooldata_common.cc +++ b/src/emc/tooldata/tooldata_common.cc @@ -245,12 +245,13 @@ void tooldata_format_toolline (int idx, space -= len; // format zero float values as %.0f for brevity #define F_ITEM(item,letter) if (!ignore_zero_values || tdata.item) { \ + char local_tmp[64] = {}; \ if (tdata.item) { \ - len = snprintf(tmp,sizeof(tmp)," " letter "%+f", tdata.item); \ + len = snprintf(local_tmp,sizeof(local_tmp)," " letter "%+f", tdata.item); \ } else { \ - len = snprintf(tmp,sizeof(tmp)," " letter "%.0f",tdata.item); \ + len = snprintf(local_tmp,sizeof(local_tmp)," " letter "%.0f",tdata.item); \ } \ - strncat(formatted_line,tmp,space); \ + strncat(formatted_line,local_tmp,space); \ space -= len; \ } #define I_ITEM(item,letter) if (!ignore_zero_values || tdata.item) { \