[PATCH v2 5/7] misc: syslog: Use static buffer

Paul Eggert eggert@cs.ucla.edu
Sat Feb 19 03:45:52 GMT 2022


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.


More information about the Libc-alpha mailing list