bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] FYI: copy-file.c tweak


From: Bruno Haible
Subject: Re: [Bug-gnulib] FYI: copy-file.c tweak
Date: Fri, 25 Apr 2003 21:28:06 +0200 (CEST)

Paul Eggert writes:
> How about removing the definition of buf_size and uniformly replacing
> its use with "sizeof buf"?

I find the code more readable as it is. 'buf' and 'buf_size' belong
together. In some cases we write

  char buf[4096];
  const size_t buf_size = sizeof (buf);

In others we write

  const size_t buf_size = MIN (MAX (file_size, 4096), 1048576);
  char *buf = (char *) xmalloc (buf_size);

It's nice if the inner code doesn't depend on how the buffer is
allocated.
  
> it avoids the include-file mess.

"mess"?

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]