Clear the buffer at init.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 8 Dec 2002 13:14:44 +0000 (13:14 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 8 Dec 2002 13:14:44 +0000 (13:14 +0000)
gedcom/buffer.c

index 6f807b1dc0454083045e7e4be65c027e4e281e40..8873529996a66cf7cee5d92fe0a355d03f0028a1 100644 (file)
@@ -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) {