mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 15:01:03 +08:00
Change ff_open to explicit memcpy()
This commit is contained in:
parent
f40b272eeb
commit
46af09f776
@ -986,7 +986,7 @@ static void *ff_open(const char *path, int flags) {
|
||||
if (flags & MG_FS_WRITE) mode |= FA_WRITE | FA_OPEN_ALWAYS | FA_OPEN_APPEND;
|
||||
if (f_open(&f, path, mode) == 0) {
|
||||
FIL *fp = calloc(1, sizeof(*fp));
|
||||
*fp = f;
|
||||
memcpy(fp, &f, sizeof(*fp));
|
||||
return fp;
|
||||
} else {
|
||||
return NULL;
|
||||
|
@ -74,7 +74,7 @@ static void *ff_open(const char *path, int flags) {
|
||||
if (flags & MG_FS_WRITE) mode |= FA_WRITE | FA_OPEN_ALWAYS | FA_OPEN_APPEND;
|
||||
if (f_open(&f, path, mode) == 0) {
|
||||
FIL *fp = calloc(1, sizeof(*fp));
|
||||
*fp = f;
|
||||
memcpy(fp, &f, sizeof(*fp));
|
||||
return fp;
|
||||
} else {
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user