This commit was generated by cvs2svn to compensate for changes in r120489,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
62fcef3496
@ -23,8 +23,11 @@ RCSID("$OpenBSD: buffer.c,v 1.17 2003/09/16 03:03:47 deraadt Exp $");
|
||||
void
|
||||
buffer_init(Buffer *buffer)
|
||||
{
|
||||
buffer->alloc = 4096;
|
||||
buffer->buf = xmalloc(buffer->alloc);
|
||||
const u_int len = 4096;
|
||||
|
||||
buffer->alloc = 0;
|
||||
buffer->buf = xmalloc(len);
|
||||
buffer->alloc = len;
|
||||
buffer->offset = 0;
|
||||
buffer->end = 0;
|
||||
}
|
||||
@ -34,8 +37,10 @@ buffer_init(Buffer *buffer)
|
||||
void
|
||||
buffer_free(Buffer *buffer)
|
||||
{
|
||||
memset(buffer->buf, 0, buffer->alloc);
|
||||
xfree(buffer->buf);
|
||||
if (buffer->alloc > 0) {
|
||||
memset(buffer->buf, 0, buffer->alloc);
|
||||
xfree(buffer->buf);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user