mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 05:39:00 +08:00
Fix #1514 - explicitely initialize io in mg_iobuf_init()
This commit is contained in:
parent
e5d1b213c9
commit
85281ae128
@ -1998,6 +1998,8 @@ int mg_iobuf_resize(struct mg_iobuf *io, size_t new_size) {
|
||||
}
|
||||
|
||||
int mg_iobuf_init(struct mg_iobuf *io, size_t size) {
|
||||
io->buf = NULL;
|
||||
io->size = io->len = 0;
|
||||
return mg_iobuf_resize(io, size);
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,8 @@ int mg_iobuf_resize(struct mg_iobuf *io, size_t new_size) {
|
||||
}
|
||||
|
||||
int mg_iobuf_init(struct mg_iobuf *io, size_t size) {
|
||||
io->buf = NULL;
|
||||
io->size = io->len = 0;
|
||||
return mg_iobuf_resize(io, size);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user