mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Prefer memcpy() over struct-copy.
This commit is contained in:
parent
4ca8569488
commit
aaef4bee27
|
@ -120,7 +120,7 @@ int upx_ucl_compress ( const upx_bytep src, unsigned src_len,
|
||||||
|
|
||||||
ucl_compress_config_t cconf; cconf.reset();
|
ucl_compress_config_t cconf; cconf.reset();
|
||||||
if (cconf_parm)
|
if (cconf_parm)
|
||||||
cconf = cconf_parm->conf_ucl; // struct copy
|
memcpy(&cconf, &cconf_parm->conf_ucl, sizeof(cconf)); // cconf = cconf_parm->conf_ucl; // struct copy
|
||||||
|
|
||||||
ucl_uint *res = cresult->result_ucl.result;
|
ucl_uint *res = cresult->result_ucl.result;
|
||||||
// assume no info available - fill in worst case results
|
// assume no info available - fill in worst case results
|
||||||
|
|
|
@ -68,8 +68,7 @@ PackMaster::PackMaster(InputFile *f, options_t *o) :
|
||||||
saved_opt = o;
|
saved_opt = o;
|
||||||
if (o)
|
if (o)
|
||||||
{
|
{
|
||||||
this->local_options = *o; // struct copy
|
memcpy(&this->local_options, o, sizeof(*o)); // struct copy
|
||||||
//memcpy(&this->local_options, o, sizeof(*o)); // struct copy
|
|
||||||
opt = &this->local_options;
|
opt = &this->local_options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user