[sword-cvs] sword/include swbuf.h,1.21,1.22
sword@www.crosswire.org
sword@www.crosswire.org
Mon, 4 Aug 2003 12:06:06 -0700
Update of /usr/local/cvsroot/sword/include
In directory www:/tmp/cvs-serv12449/include
Modified Files:
swbuf.h
Log Message:
Index: swbuf.h
===================================================================
RCS file: /usr/local/cvsroot/sword/include/swbuf.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- swbuf.h 17 Jul 2003 23:20:41 -0000 1.21
+++ swbuf.h 4 Aug 2003 19:06:03 -0000 1.22
@@ -48,8 +48,9 @@
long newsize = (end-buf)+pastEnd;
allocSize = newsize + 16;
long size = (end - buf);
- buf = (char *)((buf) ? realloc(buf, allocSize) : calloc(allocSize, 1));
+ buf = (char *)((buf) ? realloc(buf, allocSize) : malloc(allocSize));
end = (buf + size);
+ *end = 0;
endAlloc = buf + allocSize-1;
}
}
@@ -57,8 +58,9 @@
if (newsize > allocSize) {
allocSize = newsize + 16;
long size = (end - buf);
- buf = (char *)((buf) ? realloc(buf, allocSize) : calloc(allocSize, 1));
+ buf = (char *)((buf) ? realloc(buf, allocSize) : malloc(allocSize));
end = (buf + size);
+ *end = 0;
endAlloc = buf + allocSize-1;
}
}