mirror of
https://github.com/json-c/json-c.git
synced 2026-03-21 14:09:06 +08:00
Merge pull request #750 from c3h2-ctf/clearmem
printbuf_memset(): set gaps to zero
This commit is contained in:
@@ -120,6 +120,8 @@ int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (pb->bpos < offset)
|
||||
memset(pb->buf + pb->bpos, '\0', offset - pb->bpos);
|
||||
memset(pb->buf + offset, charvalue, len);
|
||||
if (pb->bpos < size_needed)
|
||||
pb->bpos = size_needed;
|
||||
|
||||
Reference in New Issue
Block a user