mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
stm32f7 example starts on real h/w, with plus-TCP driver
This commit is contained in:
1 parent
0f32f50c50
commit
47e5e984df
30 files changed
+3716
-1257
No files matched your search
+2
-2
@@ -19,9 +19,9 @@ int mg_iobuf_resize(struct mg_iobuf *io, size_t new_size) {
|
||||
io->buf = NULL;
|
||||
io->len = io->size = 0;
|
||||
} else if (new_size != io->size) {
|
||||
// NOTE(lsm): do not use realloc here. Use malloc/free only, to ease the
|
||||
// NOTE(lsm): do not use realloc here. Use calloc/free only, to ease the
|
||||
// porting to some obscure platforms like FreeRTOS
|
||||
void *p = malloc(new_size);
|
||||
void *p = calloc(1, new_size);
|
||||
if (p != NULL) {
|
||||
size_t len = new_size < io->len ? new_size : io->len;
|
||||
if (len > 0) memcpy(p, io->buf, len);
|
||||
|
||||
Reference in new issue
Block a user