From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra.cs.ucla.edu (zimbra.cs.ucla.edu [131.179.128.68]) by sourceware.org (Postfix) with ESMTPS id 7A888385F021 for ; Sat, 19 Feb 2022 03:45:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A888385F021 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EC03F16018A; Fri, 18 Feb 2022 19:45:53 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id mk7vM742aUkw; Fri, 18 Feb 2022 19:45:53 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 50483160192; Fri, 18 Feb 2022 19:45:53 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Dr3Iu5D1luzj; Fri, 18 Feb 2022 19:45:53 -0800 (PST) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 26AD116018A; Fri, 18 Feb 2022 19:45:53 -0800 (PST) Message-ID: <0600985c-8cf8-5c92-7ea1-8b6abe905084@cs.ucla.edu> Date: Fri, 18 Feb 2022 19:45:52 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Adhemerval Zanella References: <20220218142322.432304-1-adhemerval.zanella@linaro.org> <20220218142322.432304-6-adhemerval.zanella@linaro.org> From: Paul Eggert Organization: UCLA Computer Science Department Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v2 5/7] misc: syslog: Use static buffer In-Reply-To: <20220218142322.432304-6-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Feb 2022 03:45:55 -0000 On 2/18/22 06:23, Adhemerval Zanella via Libc-alpha wrote: > + /* Try to use a static buffer as an optimization. */ > + char bufs[bufs_size]; This is not a static buffer; it's a buffer whose size is static. Perhaps change "static buffer" to "fixed-sized buffer" in the comment and commit message. > + int l = __snprintf (bufs, sizeof bufs, > + SYSLOG_HEADER (pri, timestamp, &msgoff, pid)); > + if (l < sizeof (bufs)) "sizeof (bufs)" -> "sizeof bufs" for consistency and simplicity, both here and elsewhere in the file.