Re: which way to update export_args structure?

From: John-Mark Gurney <jmg_at_funkthat.com>
Date: Tue, 23 Oct 2018 10:04:32 -0700
Brooks Davis wrote this message on Mon, Oct 22, 2018 at 16:05 +0000:
> > +			switch (len) {
> > +			case (sizeof(struct oexport_args)):
> > +			case (sizeof(struct o2export_args)):
> > +				memset(&export, 0, sizeof(export));
> 
> I think this is now redundant.
> 
> > +				memset(&o2export, 0, sizeof(o2export));
> 
> This is certainly redundant given that you immediately copy over it.

This is not redundant if sizeof oexport_args < sizeof o2export, and
len == sizeof oexport_args...  It zeros out the remaining of the buffer..

> > +				memcpy(&o2export, bufp, len);

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

Received on Tue Oct 23 2018 - 15:04:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:19 UTC