From: Peter Verthez Date: Sun, 8 Dec 2002 13:14:44 +0000 (+0000) Subject: Clear the buffer at init. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=b433859c349f125277c5c58ad3f8c195cc3ed005;p=gedcom-parse.git Clear the buffer at init. --- diff --git a/gedcom/buffer.c b/gedcom/buffer.c index 6f807b1..8873529 100644 --- a/gedcom/buffer.c +++ b/gedcom/buffer.c @@ -51,8 +51,8 @@ void init_buffer(struct safe_buffer *b) if (b && b->buffer == NULL) { b->buffer = (char *)malloc(INITIAL_BUF_SIZE); if (b->buffer) { - b->buffer[0] = '\0'; b->bufsize = INITIAL_BUF_SIZE; + memset(b->buffer, 0, b->bufsize); b->buf_end = b->buffer; b->buflen = 0; if (b->cleanup_func && atexit(b->cleanup_func) != 0) {