mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-28 07:28:13 +08:00
Fix zeromem() call in mg_iobuf_del()
This commit is contained in:
parent
e3589577ed
commit
28a56370d4
@ -1782,7 +1782,7 @@ size_t mg_iobuf_del(struct mg_iobuf *io, size_t ofs, size_t len) {
|
||||
if (ofs > io->len) ofs = io->len;
|
||||
if (ofs + len > io->len) len = io->len - ofs;
|
||||
memmove(io->buf + ofs, io->buf + ofs + len, io->len - ofs - len);
|
||||
zeromem(io->buf + ofs + io->len - len, len);
|
||||
zeromem(io->buf + io->len - len, len);
|
||||
io->len -= len;
|
||||
return len;
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ size_t mg_iobuf_del(struct mg_iobuf *io, size_t ofs, size_t len) {
|
||||
if (ofs > io->len) ofs = io->len;
|
||||
if (ofs + len > io->len) len = io->len - ofs;
|
||||
memmove(io->buf + ofs, io->buf + ofs + len, io->len - ofs - len);
|
||||
zeromem(io->buf + ofs + io->len - len, len);
|
||||
zeromem(io->buf + io->len - len, len);
|
||||
io->len -= len;
|
||||
return len;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user