mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-12 16:50:21 +00:00
Fix #2612 - struct mg_str::ptr -> buf
This commit is contained in:
1 parent
e93d18d200
commit
e0e599ffa1
61 files changed
+684
-686
No files matched your search
@@ -15,14 +15,14 @@ static void signal_handler(int sig_num) {
|
||||
bool web_load_settings(void *buf, size_t len) {
|
||||
bool ok = false;
|
||||
struct mg_str data = mg_file_read(&mg_fs_posix, CONFIG_FILE);
|
||||
if (data.ptr == NULL) {
|
||||
if (data.buf == NULL) {
|
||||
MG_ERROR(("Error reading %s", CONFIG_FILE));
|
||||
} else if (data.len != len) {
|
||||
MG_ERROR(("%s size != %lu", CONFIG_FILE, len));
|
||||
} else {
|
||||
memcpy(buf, data.ptr, len);
|
||||
memcpy(buf, data.buf, len);
|
||||
}
|
||||
free((void *) data.ptr);
|
||||
free((void *) data.buf);
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user