From nobody Fri Jun 12 13:58:30 2026 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3452B3033EC; Thu, 14 May 2026 16:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778776045; cv=none; b=a+khIwvZySLp37F+/Y+sf6bU67RdiPgBxlL6evjZetipDX52s28YcBzG8fCi6xz49tnOrLHQ9nwd+/D/qayrAbgGQFXWGQWyimPrHm8KvM2IeAnJX5UrvU0Lxs6U+QOzQC34XlXrb0/nIdGFM3zHvhtC6A5o3CywUXKtchLy6h4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778776045; c=relaxed/simple; bh=8ud/dWWNnFaJNyMokCx7aud/a7TX58XT8/HmBCqeWDE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fiq4WA6K5tO9fTF+Nqu/xhXJAJqDFZptZNtCRU+FC5B+n8SGg/CE2Z5JbEzLL7a3SJkuJIVHS+fvRERfJtCcmyWCz7T6GViL/C4rrEs56LhRdhM4q/od9jEksHn7f0Ya5+6j1++FUyoanVBkejx1Vba4uRgpf1nKu1YoGaNbg4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=XgFv/1SP; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=b0w3vFZe; arc=none smtp.client-ip=80.241.56.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="XgFv/1SP"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="b0w3vFZe" Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4gGbMZ1jpXz9v9K; Thu, 14 May 2026 18:27:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1778776042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXo7vXk51/MxewuEblMFL/lSUUQ8x5gJrNXUpDl0w7k=; b=XgFv/1SPO2jFHjoA4hTpe+S23n2l2OtyOuvW/vnNX/9K6TDgUNNsyWMKBsg5j+2TfpiDki KhVKW1IHtECaJbauFyYjuOaJz2naYHAqq992viQlUiWW5zX9pzK0pUym+lgrflRVbAIqg7 uzwH7XPVF0U6YJlQWQQY2y0OkO7KhzwRIU76SzuKJiVtJaUiBYjzvZZIurnx0jZwakdhoc WELADaqYvQGzAcZsXFxOz6UfaOlW3hxa5zHPMSN69tHiukO+CiExrfUkCwYin0/8fsMJhW CEmtWdn6YrbfjA94FTnsixCbZHNwDUAVkm/GADBk4fVsa0hpfMX11M6hIKE9oA== Authentication-Results: outgoing_mbo_mout; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=b0w3vFZe; spf=pass (outgoing_mbo_mout: domain of manuelebner@mailbox.org designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=manuelebner@mailbox.org From: Manuel Ebner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1778776041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xXo7vXk51/MxewuEblMFL/lSUUQ8x5gJrNXUpDl0w7k=; b=b0w3vFZeCU6spjtWW6zPavI+cE4ZWR5uOnjL3SCJv9vR0niZ32NhQOLkxg3YFL/QTj3Xfg EFn82k9UpxEVTUrpUe+hW3gRqp6c636CHIrHmKTd7CCe1D0G9LJ6biDPiCQ1QvPWdu3dTY yXPN+EbfSDoKkxMTfMWgEsR5gtuBeYkmupPppeRFKTFhmv8AJ8ltBbZoX2Hs8bBK2YGtFf cZROxvuVUezoMmL9Gp5qt4gO7ypY9Xbg8QCaye4lmME1ep/Ibtgjb8rfl+aqVQTQ9h+pvi oVx52vJQqwkV9eAFYfLPw5f2XVtqA0fI9O8E4pp16ixe0My7zN+s9xw1U5wQYw== To: Andy Shevchenko , Kees Cook , Jonathan Corbet , Shuah Khan , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Geert Uytterhoeven , David Laight , Randy Dunlap , Jani Nikula , Heiko Carstens , workflows@vger.kernel.org (open list:DOCUMENTATION PROCESS), linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-kernel@vger.kernel.org (open list) Cc: Manuel Ebner Subject: [PATCH v2 1/3] Doc: deprecated.rst: add strlcat() Date: Thu, 14 May 2026 18:26:53 +0200 Message-ID: <20260514162652.107714-2-manuelebner@mailbox.org> In-Reply-To: <20260514160719.105084-3-manuelebner@mailbox.org> References: <20260514160719.105084-3-manuelebner@mailbox.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MBO-RS-ID: 1c7ec18dd860b3588e3 X-MBO-RS-META: sqrm6j37hty3bgi75q3fk5c5u4j1x56t X-Rspamd-Queue-Id: 4gGbMZ1jpXz9v9K Content-Type: text/plain; charset="utf-8" add strlcat and alternatives Signed-off-by: Manuel Ebner --- Documentation/process/deprecated.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/process/deprecated.rst b/Documentation/process/d= eprecated.rst index fed56864d036..06e802f4bbfd 100644 --- a/Documentation/process/deprecated.rst +++ b/Documentation/process/deprecated.rst @@ -153,6 +153,13 @@ used, and the destinations should be marked with the `= __nonstring attribute to avoid future compiler warnings. For cases still needing NUL-padding, strtomem_pad() can be used. =20 +strlcat() +--------- +strlcat() must re-scan the destination string from the beginning on each +call (O(n^2) behavior). Alternatives are seq_buf_puts() and seq_buf_printf= (). +snprintf(), scnprintf() and sysfs_emit() are possible aswell, but the adop= tion +of the arguments needs to be taken care off. + strlcpy() --------- strlcpy() reads the entire source buffer first (since the return value --=20 2.54.0 From nobody Fri Jun 12 13:58:30 2026 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8405F314B96; Thu, 14 May 2026 16:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.161 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778776190; cv=none; b=eXkj8+m6Cag+EalX5PoCpVB9hpqrYL6BV6++7T44dBsNkecGxLxEeK3AWjwWvPtRFxvFlsun8diGdbq+8hzeZ8IEU6Ic/vAMyui81bGFIuERMJWqg0cM0/50dGlz1GjK++PjUJq+864xpRAJ92Ap1jeZQtRzBPEeJOMRIMsBnsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778776190; c=relaxed/simple; bh=N4I4F7exIEuEPOld5JnQ/WvRQPnxRw2aZDJ08Qkrqa4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rv1Fbheb8q5Sq1u+0u3Vbb0quOfMmu0cEwdL3oE7sVzFAbv/KmlBwaseP91w2dR4+VbP15o/16DovDQbEWEFh8T7Qq7VooaI8GNmBBRyiouB6KHLZIb2OPv3pFJqTHD+StmXjL5jO43izkIbco5/q7tiTzWz+z8hMpp9plgDMDg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=XpF/Us86; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=e1oBiQTD; arc=none smtp.client-ip=80.241.56.161 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="XpF/Us86"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="e1oBiQTD" Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4gGbQL40xwz9tsf; Thu, 14 May 2026 18:29:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1778776186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nT3V7Q0/PBLhoKcxHcZf/465dWwCX67tKOpGhQAmip8=; b=XpF/Us86VnN2n7HNXmqYVFs43DVen/cAMvQK1mehOBeKXgnA8aaEaAMwHax3qyJJgqAw3f ISoOnqVoH0AB9r+NNFiCejehH7jNpgPqyY7bprM2kUaKkMRiXt7Wl24pdEOUsDCNsBqiwl RgKc81QE8eD5q4FEUxX7GEcHolgPzKHyrfgIARDQKPolH84kWHLhxy1a2Jzf7dKvzqvasG rYCQn5TIpFJDoYGMdh8CwqQGPNiV7vnrql/elsa9pYn+pIS8nzIvQkotdQnxLuSfy1nwkF NiRxRQdu4jKDFMf2WaEla6/VVzFymibycaBtNLdq3MeyI1dOQ2BcKldDN5CGcg== From: Manuel Ebner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1778776184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nT3V7Q0/PBLhoKcxHcZf/465dWwCX67tKOpGhQAmip8=; b=e1oBiQTDSBBpGle+kuQDRGwWegFJfHMnPukyXJRs426SoMwLYKewe7LvVIa6QSeTA/vMuj nwVi4pVwM+NsLK+v2J+vDxsAsYGtMMPpmIOMGoF1bPqLI5r7h5n7ccQacv99Vu4ynUy2YX CSrt5L1Pp9US60lKAEphUPZAWTD2xNB5/MbQgnGsWDj0n1Me2LeluIJPGBM5vfM73Zu7Pp jQdvdxhMSMyXAgkgocP7MTkz+lhxDQUKQpDh++4m1U9OWeg59ZGGBqQA8pEdTIWgObJsf8 Rq6yFzoU1I+4Imq9ptb6SpKnU9973xVJInVUYjOEUf+px3PXIrepH0EScHI07A== To: Andy Shevchenko , Kees Cook , Jonathan Corbet , Shuah Khan , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Geert Uytterhoeven , David Laight , Randy Dunlap , Jani Nikula , Heiko Carstens , workflows@vger.kernel.org (open list:DOCUMENTATION PROCESS), linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-kernel@vger.kernel.org (open list) Cc: Manuel Ebner Subject: [PATCH v2 2/3] scripts: checkpatch.pl: add warning for strlcat() Date: Thu, 14 May 2026 18:28:59 +0200 Message-ID: <20260514162858.107919-2-manuelebner@mailbox.org> In-Reply-To: <20260514160719.105084-3-manuelebner@mailbox.org> References: <20260514160719.105084-3-manuelebner@mailbox.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MBO-RS-META: 1jzrei5syh7ts419sek8pdyc456y4qex X-MBO-RS-ID: 3da5c52ef4c6684c43d Content-Type: text/plain; charset="utf-8" add a warning for strlcat() Signed-off-by: Manuel Ebner Reviewed-by: Kees Cook --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0492d6afc9a1..4c1b43ebe00d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -7085,6 +7085,12 @@ sub process { "Prefer strscpy over strlcpy - see: https://github.com/KSPP/linux/= issues/89\n" . $herecurr); } =20 +# strlcat uses that should be a more supported function + if ($line =3D~ /\bstrlcat\s*\(/ && !is_userspace($realfile)) { + WARN("STRLCAT", + "Prefer a more supported function over strlcat - see: https://gith= ub.com/KSPP/linux/issues/370\n" . $herecurr); + } + # strncpy uses that should likely be strscpy or strscpy_pad if ($line =3D~ /\bstrncpy\s*\(/ && !is_userspace($realfile)) { WARN("STRNCPY", --=20 2.54.0 From nobody Fri Jun 12 13:58:30 2026 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F00D316189; Thu, 14 May 2026 16:32:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778776343; cv=none; b=ZkTgWgWxCm2Sm2liUK6BOsNkjCN975xHAlyZRkLdOdRKHJK84vWgMIO0ZjGeKDK9qnnyK1JibhUZr0tx06w6JxgmsdLWu315pIygRK9Fk6I5fih7fUXzuXsPIa1SH32Ms26V2z1Z9NbHxAPGcl/1QFQ2vAdr3O54vKpAkqVZzzA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778776343; c=relaxed/simple; bh=szoEGNrlBJ1LmQeDYolT3AAJQsNm38AgeFz4jvHb5/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A/EEcPMcxTOXqrKBv358pQytTNayLdyF16Qh5aUHRdWw1qqaXlljK40O6k1SDIUA73MEGuzJAxGl9It80pACOs9u5IZF/xNtkbidnR2e9BSIKLK9K8KVelyAebgV5oUHDpFWpxZNpYWQGMjL/gzWjA6Ndpaev+wZGqcDyUIqCUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=VMWQCvYK; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=tTbnCPqi; arc=none smtp.client-ip=80.241.56.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="VMWQCvYK"; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b="tTbnCPqi" Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4gGbTJ1N4gz9vDd; Thu, 14 May 2026 18:32:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1778776340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oSTZX/Nl4yJO2d5YuuigYg8EBLAOIxbQfoWFH41gpEE=; b=VMWQCvYKG3Wv51ppxm8fHLU3KZD/hjsQB2k9xTbHHITAU+J2p28gg9Q1/vgTyZwZxSjwLr GKs9MiStYjYkmileJx0X0CNO9/2+X5kjV+ItiA5TWB7onfxsuPwps41g1PZQJgAF4TiBgp Bl87maHptHSuyQFFR99sEMVmmLwvxDyVbtlO8Q1V29pp5360xyNHd/cvmVOL/JaChIHYiX FBWXA8wKb+Yq0xmuYpkiDaTo900XyTsZEZqmsdFQQ1kkxlUOc1dGzynx32vppVOvXk/4Tv 6FUwf/4Y2Bakqe8GSC0PU3iyEco5Xk8KJhmM9AnIC0tzLeDmFUiOtGpOGkMi/A== Authentication-Results: outgoing_mbo_mout; dkim=pass header.d=mailbox.org header.s=mail20150812 header.b=tTbnCPqi; spf=pass (outgoing_mbo_mout: domain of manuelebner@mailbox.org designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=manuelebner@mailbox.org From: Manuel Ebner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1778776338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oSTZX/Nl4yJO2d5YuuigYg8EBLAOIxbQfoWFH41gpEE=; b=tTbnCPqirFTqHrrBjR0Zt1etM9peSjaDGnDfNoKHS6TF8ySRa9ETc/7bN5cuB9goNNKviC 4Kr27n6Y8tFAJChaLfwagLd0gjnK+hEy1H4c/jMip8LysK92VAm8SIdwLA7wmkwnrAOKps rQwtH3XflfgKstoXEY83SCSYNYSMHYAmTVG0/NogM/pLbtaKNSYnxsTKHNQYvEx9u0z8QP 4RRQYx91y4vgoIkV3E8PpY7Ija0m5STgtvpRFCpf8gnqn+Qdbifa4dezdem/7XJqmgErpF iH4NTNaHiYN3U2T51gpzirqc2q/egInJGWkbCAzEJn+pBlRcmSX2zWtwR0v/xA== To: Andy Shevchenko , Kees Cook , Jonathan Corbet , Shuah Khan , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Geert Uytterhoeven , David Laight , Randy Dunlap , Jani Nikula , Heiko Carstens , workflows@vger.kernel.org (open list:DOCUMENTATION PROCESS), linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-kernel@vger.kernel.org (open list) Cc: Manuel Ebner Subject: [PATCH v2 3/3] drivers: add deprecated remarks to strlcat() Date: Thu, 14 May 2026 18:30:34 +0200 Message-ID: <20260514163033.108009-2-manuelebner@mailbox.org> In-Reply-To: <20260514160719.105084-3-manuelebner@mailbox.org> References: <20260514160719.105084-3-manuelebner@mailbox.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MBO-RS-ID: 69646e659f84f55dfa2 X-MBO-RS-META: 8zocm5d1yzxojme1h5f5m63crjw9u7m1 X-Rspamd-Queue-Id: 4gGbTJ1N4gz9vDd Content-Type: text/plain; charset="utf-8" add kernel-doc comment to strlcat() function definitions Signed-off-by: Manuel Ebner --- lib/string.c | 11 +++++++++++ tools/include/nolibc/string.h | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/lib/string.c b/lib/string.c index b632c71df1a5..0a44ca5ca7e6 100644 --- a/lib/string.c +++ b/lib/string.c @@ -249,6 +249,17 @@ EXPORT_SYMBOL(strncat); #endif =20 #ifndef __HAVE_ARCH_STRLCAT +/** + * strlcat - Append a string to an existing string + * + * @dest: pointer to %NUL-terminated string to append to + * @src: pointer to %NUL-terminated string to append from + * @count: Maximum bytes available in @dest + * + * Do not use this function. Prefer building the string with + * formatting, via scnprintf(), seq_buf, or similar. + * + */ size_t strlcat(char *dest, const char *src, size_t count) { size_t dsize =3D strlen(dest); diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h index 4000926f44ac..1a4b51135705 100644 --- a/tools/include/nolibc/string.h +++ b/tools/include/nolibc/string.h @@ -208,6 +208,17 @@ char *strndup(const char *str, size_t maxlen) } =20 static __attribute__((unused)) +/** + * strlcat - Append a string to an existing string + * + * @dst: pointer to %NUL-terminated string to append to + * @src: pointer to %NUL-terminated string to append from + * @size: Maximum bytes available in @dst + * + * Do not use this function. Prefer building the string with + * formatting, via scnprintf(), seq_buf, or similar. + * + */ size_t strlcat(char *dst, const char *src, size_t size) { size_t len =3D strnlen(dst, size); --=20 2.54.0