mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-27 20:48:29 +00:00
Change ff_open to explicit memcpy()
This commit is contained in:
1 parent
f40b272eeb
commit
46af09f776
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -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 (flags & MG_FS_WRITE) mode |= FA_WRITE | FA_OPEN_ALWAYS | FA_OPEN_APPEND;
|
||||||
if (f_open(&f, path, mode) == 0) {
|
if (f_open(&f, path, mode) == 0) {
|
||||||
FIL *fp = calloc(1, sizeof(*fp));
|
FIL *fp = calloc(1, sizeof(*fp));
|
||||||
*fp = f;
|
memcpy(fp, &f, sizeof(*fp));
|
||||||
return fp;
|
return fp;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
+1
-1
@@ -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 (flags & MG_FS_WRITE) mode |= FA_WRITE | FA_OPEN_ALWAYS | FA_OPEN_APPEND;
|
||||||
if (f_open(&f, path, mode) == 0) {
|
if (f_open(&f, path, mode) == 0) {
|
||||||
FIL *fp = calloc(1, sizeof(*fp));
|
FIL *fp = calloc(1, sizeof(*fp));
|
||||||
*fp = f;
|
memcpy(fp, &f, sizeof(*fp));
|
||||||
return fp;
|
return fp;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in new issue
Block a user