On Wed, Mar 09, 2016 at 08:54:51AM +0100, Paolo Bonzini wrote: > > @@ -1292,7 +1291,7 @@ static void *source_return_path_thread(void *opaque) > > > > if ((rp_cmd_args[header_type].len != -1 && > > header_len != rp_cmd_args[header_type].len) || > > - header_len > max_len) { > > + header_len > sizeof(buf)) { > > sizeof works fine because buf is an array of bytes, but ARRAY_SIZE is > better because it works for any type of buffer.
I carefully chose "sizeof" out of "ARRAY_SIZE" as commented by Eric that, we'd better use sizeof() for char typed buffers. Will this be related to how header_len is defined? That's something I do not know... :( E.g., if it's defined as "length in bytes", then shall we better use sizeof() in all cases? Anyway, I take my above question as trivial since current buffer is char typed. Thanks! Peter