Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2029402pxk; Mon, 14 Sep 2020 02:53:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxewIIs5imf3ajYkRemfZQlEH/cQv5n8sNJEj7mYzFI8zL+tWik3p0t616LlZZ+iPsvaIUx X-Received: by 2002:a17:906:2c14:: with SMTP id e20mr14418186ejh.205.1600077181532; Mon, 14 Sep 2020 02:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600077181; cv=none; d=google.com; s=arc-20160816; b=Fn5d9sjwB0jvcYTJXNftx1eysYAz2AjjfgSbwG9XlkAGoHS1YigX319pgGc+h5mLCP hhk5jClmeNS1iFtI+yIaaIcmmWPcal8PDgn00ySAPR5s/IoLx+9/DauizehGCobcR6EH F0L00UxQvI7DbYM+8Weq5oAJXdRJ4lKosDKD9QddkT7mexUQG6ZwOyfnHScz4U4ZCObk q6ewTyBKS2W1GU/8SDHFTf8btQWI8Cx1yHt7evErCYqAyXClRalJ7Gykb/q6hImaTr7O PgSAjWgz7CZrwYPYHVqOtbKdbxT6vhZlkJG3PPmHzcYfdTPAR9tUjU9yEfXUDjIQVY0v Ccyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=OdPU8Glfgir5UGsLoaaR7zgD8ovaCIilI+lFeo550Mc=; b=Sau2XEMIPUGy5XzGDmU9zcweIiKDOnkndz3CFS6H9fKaIvfVeL7UDWmyDiB5PYa9xg BsGFJjEaFhm6pH6M3rp1T8FyycTkv4MjvSmFIg6mcpLjcS9M1FCs9nqt3tEYlqew2gz7 9IqF/yiwuH4bHe/oe+Uhf9XE8F6GUOoqMUyOQxzqfZBLxrGQcSYImAcC8lJvvw9Oxrmi l97bmPB47lBeM7Tne3qdhCDKRK5pnysWO2h8BEDmqpxXZCQl9k8LptMM7bz2PMpcgFgv fvPdXDWZ7QKNcB7opZHdjl8iqp7tGC/XMImgEbX6CG5US6mFLWuXP9jROBwUyFYFY5iV sbjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b49weJcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p11si6437314eji.157.2020.09.14.02.52.38; Mon, 14 Sep 2020 02:53:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=b49weJcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbgINJvk (ORCPT + 99 others); Mon, 14 Sep 2020 05:51:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbgINJvj (ORCPT ); Mon, 14 Sep 2020 05:51:39 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D82C06174A; Mon, 14 Sep 2020 02:51:38 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id z4so18005042wrr.4; Mon, 14 Sep 2020 02:51:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OdPU8Glfgir5UGsLoaaR7zgD8ovaCIilI+lFeo550Mc=; b=b49weJcH6PKR2Z53mJBlxpDIYL0sIIAyGxhNIHuIupgPHXDkqT8WMNvBLi67Wg/Vtu X8t87+drB2WSh86N7yG0ae2zRb5sG5KacfLS1XkMOk10lfNTRy0RMBoEdflqx8DCBlvL gSQ4+oJTH8D3wPdNxMEr6v//fJDbzLebLUhaJq0BwCl8xx+EY3ODoaSXyIU78Tqsd4Yj UCiqqjKxd7OSve+LgMMsnz+gGV3iy0SFX82X0evk2OeSRvO4s3HmXqDZ5on9Hdb0X1dm W3N9TAUoEQckxOIS3+kmTR2FZEakukP8wDfni8PPPYSmquQqAmQ6iNOTMc53aKG+h0kX mq9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OdPU8Glfgir5UGsLoaaR7zgD8ovaCIilI+lFeo550Mc=; b=JWc01H9jpIG+01ycA1U2QS9Lp4hwtswVdx4fdFp/A04+D90dQQF0Sj3OUgSvQZKgCh WgWdq0giJ1LzOwafidzPOrYh3kKxWA+uvOhRbv2Hm/mKhGtTgwbq0n5vcf3vi1pecSd0 HfTJUTzHI7fEEaBI/NjI2MqaMgQsprwvet455UlKKnJQHz7LkNq3R9PGlhRKjGtNWXkJ qj/lshZiB493UGv14x40e9EUYA3sKgZuB8QAISg/bhGO/ouvJR3598gTA2vj3+mKBHKU ZERNnGxwb7mqYBj1KxOr5Oofq1tw6wX40wFgrIA3CTgi4PibBYRJWxXGGbeEIWqfV5vu sJTw== X-Gm-Message-State: AOAM531hcRJviQVCADb6AwSVIYxUpxNGaPSGlWayJT8GrKOjDnmVc24x t7NVBKXuZkHj+0J5H0TpNXKodaF/IGFQVA== X-Received: by 2002:a5d:518b:: with SMTP id k11mr14712742wrv.369.1600077095401; Mon, 14 Sep 2020 02:51:35 -0700 (PDT) Received: from [192.168.0.160] ([93.115.133.118]) by smtp.gmail.com with ESMTPSA id o4sm19620709wru.55.2020.09.14.02.51.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Sep 2020 02:51:34 -0700 (PDT) Subject: Re: AW: AW: [PATCH 12/24] getgrent_r.3: Use sizeof() to get buffer size (instead of hardcoding macro name) To: Walter Harms , "mtk.manpages@gmail.com" Cc: "linux-man@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20200910211344.3562-1-colomar.6.4.3@gmail.com> <20200910211344.3562-13-colomar.6.4.3@gmail.com> <00ae0174f35241efa962286b9247c590@bfs.de> <67f68125677e4e17aa1742b88267e05f@bfs.de> From: Alejandro Colomar Message-ID: Date: Mon, 14 Sep 2020 11:51:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <67f68125677e4e17aa1742b88267e05f@bfs.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Walter, On 9/14/20 11:24 AM, Walter Harms wrote: > missunderstanding, > i do not want to discuss sizeof() vs define I did understand, that was point (3). > > in this example you do: > #define BUFLEN 4096 > char buf[BUFLEN]; > getgrent_r(&grp, buf, sizeof(buf), &grpp); > > so there is no real need for BUFLEN anymore > so donig > char buf[BUFLEN]; -> char buf[4096]; > would remove BUFLEN > However, I think that might be better as a separate patch. I really don't have many arguments for nor against it. Thanks, Alex