Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp583883rdb; Sun, 18 Feb 2024 02:22:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWlL1YjUbVHg+yNF8cFIqdx2As9sr4dL4htnBSQwgZFow8zjtVZFyd5PHs4NOXbw1S8F5n0DfE7V1q75EgdNtf3/2dWj9TSOzejHJyFSQ== X-Google-Smtp-Source: AGHT+IGQT1peZKSJWOI97k1Qee1axxgP8P+4mt5S+xi5VYCjwLyTyp5YGQ/N1gF3k9frz83arie+ X-Received: by 2002:a50:ee82:0:b0:564:5216:7c1a with SMTP id f2-20020a50ee82000000b0056452167c1amr791646edr.21.1708251772069; Sun, 18 Feb 2024 02:22:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708251772; cv=pass; d=google.com; s=arc-20160816; b=wbdW+HfuvHGtNwHpVgTZTyAZJJ2fouIzqcHEFJWvnpwvbNBNhiOgq0psKzPkhDBG+A +HDafMQMZS6H52ZQaHbV3NqOoQBQFsEN9ZWzPx200WePpgr4B/Dpuw1JluF8DPBOeFJt LqoyKVY289fR18/18qZJxEpEaKH0xJnXy/P/ibTlxjwmNzxtTvOh26TAul6Q/yUJv/A0 jbPnlRwhBZyFZWQGYEBrJgOEoIgMhd5bCB7eKZwl/925U/HoNd+RCha649sSZ0o6z4iX 6J5RqajPrKadJm1aPEVvwDSsTacvfQ5MhRPt9QA4ZU+MzeY6d5JUYtbaeG9THvC2tIwt DVmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=8mqExhzEcvLp4IUi0DBEYUV5PRK1vDXRmlOIA8yO8CI=; fh=E9+ko7sPlyxPjcJvXPlA8k/l1NtMODP18pGC6Tm/ghk=; b=fiuBx6wAuVDsoK2sl+YHUfYmsIMIJi5XGh8kAp2dz9KqFgXiqMiTCGRgj1Er0FIXi5 Fi5BpPEVFPFZBPsaniVQ06vREB34cOKDCDWHkXf4rI3WlfobfKfJzTGUazKJGWgFUYsD m6VufsZ4CbAqiopc/2wGeu/YFm+03DvWFLDvSlA3gsM8LPWSASJ5UEoGJR87xzl8sHF+ Xn/zG5MsehsiFb3GDuaVoh4yroDhzPA7a1hU2Jmyv01EJS1Hvmwl2mda9bUbnr+Gq/tR F2ZCKAIic+daNZ+gUyHOZq7/VkZiKb3hnOpLlsgViMLWM1MpkkN5hKyH13LvXo/RE1F5 8v0g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=1wt.eu); spf=pass (google.com: domain of linux-kernel+bounces-70333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70333-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s4-20020a50ab04000000b005646cf6e4ecsi126951edc.63.2024.02.18.02.22.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 02:22:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=1wt.eu); spf=pass (google.com: domain of linux-kernel+bounces-70333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70333-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D00AC1F218CF for ; Sun, 18 Feb 2024 10:22:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 482F137155; Sun, 18 Feb 2024 10:22:45 +0000 (UTC) Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 243C01B7F2 for ; Sun, 18 Feb 2024 10:22:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=163.172.96.212 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708251764; cv=none; b=m3t+ZmQ8PNgThSo/dzajX5vM9LetqyiBm8a0jiwCecVJU54jpYWu91e0AiPQXg8SUz18BOKu6iqWTfyj8s6wQFnHIblxtwb2K4wAk+g3NGjGPdGiV5gKdm0liiM7Uqs9gBI22zXDaHe7ve1O/bnfeH03NH5NyFxaQMCmovGXlTM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708251764; c=relaxed/simple; bh=gnuJ8aBOF5KQ/U+nEFYhni6Lx6+TUwWlZzTwjXaN4ZI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Gn0vrNuNDFj5iJmZErMLgWJVFBahiCxopkm27MHkA5lnNJWPBXPQpSDioXGgOAUbUF/gjY2lAti/eOsBfRBDicB5+4lSeGMuhdoLg705m6WmUg8IBl9lgejP5fCn3XWCXv9Uhq3u5wN8vvrQn86WKzeGZjuBVn8XvRiz+6OpGV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; arc=none smtp.client-ip=163.172.96.212 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 41IAMbtZ032424; Sun, 18 Feb 2024 11:22:37 +0100 Date: Sun, 18 Feb 2024 11:22:37 +0100 From: Willy Tarreau To: Rodrigo Campos Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] tools/nolibc: Fix strlcat() return code and size usage Message-ID: <20240218102237.GB32375@1wt.eu> References: <20240129141516.198636-1-rodrigo@sdfg.com.ar> <20240129141516.198636-3-rodrigo@sdfg.com.ar> <20240211104817.GA19364@1wt.eu> <10b97cd3-5690-40b2-aa8e-3fea5dd4275f@sdfg.com.ar> <197c0910-f1e5-4e55-81a3-59cb2069a1d7@sdfg.com.ar> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <197c0910-f1e5-4e55-81a3-59cb2069a1d7@sdfg.com.ar> User-Agent: Mutt/1.10.1 (2018-07-13) On Wed, Feb 14, 2024 at 07:03:10PM -0300, Rodrigo Campos wrote: > On 2/14/24 16:34, Rodrigo Campos wrote: > > size_t strlcat_rata(char *dst, const char *src, size_t size) > > { > > const char *orig_src = src; > > size_t len = 0; > > for (;len < size; len++) { > > if (dst[len] == '\0') > > break; > > } > > If you think about it, this is strnlen() and what follows is strncat(). I agree, I just didn't remember we had strnlen() nor strncat(). Willy