# Makefile for www gateway utility
# Europagate, 1995
#
-# $Id: Makefile,v 1.23 1996/01/09 17:14:34 adam Exp $
+# $Id: Makefile,v 1.24 1996/01/24 10:13:56 adam Exp $
#
SHELL=/bin/sh
#
ZDEFS=
ZINC=-I../../yaz/include
ZLIB=../../yaz/lib/libyaz.a
-MOSILIB=../../xtimosi/src/libmosi.a -lrfc
+#MOSILIB=../../xtimosi/src/libmosi.a -lrfc
LIBIRTCL=../../ir-tcl/libirtcl.a $(ZLIB) $(MOSILIB)
#NETLIB=-lnsl -lsocket
#
all: $(TPROG1) $(TPROG2)
$(TPROG1): $(P1)
- $(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB)
+ $(CC) $(CFLAGS) -o $(TPROG1) $(P1) $(OLIB) $(ZLIB)
$(TPROG2): $(P2)
$(CC) $(CFLAGS) -o $(TPROG2) $(P2) $(OLIB) $(LIBIRTCL) \
$(NETLIB) $(TCLLIB) -lm
$(TPROG3): $(P3)
- $(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB)
+ $(CC) $(CFLAGS) -o $(TPROG3) $(P3) $(OLIB) $(ZLIB)
install: install.prog install.script
* USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Log: wproto.c,v $
- * Revision 1.15 1996/01/24 08:25:32 adam
+ * Revision 1.16 1996/01/24 10:13:56 adam
+ * Bug fix: in function wo_write realloc is used only when memory is already
+ * allocated with malloc.
+ *
+ * Revision 1.15 1996/01/24 08:25:32 adam
* Buf fix: Uninitialized outbuffer_offset member.
*
* Revision 1.14 1996/01/12 13:08:07 adam
void wo_write (WCLIENT wc, const char *s, size_t len)
{
if (wc->outbuffer_offset + len >= wc->outbuffer_size)
- wc->outbuffer = realloc(wc->outbuffer, wc->outbuffer_size +=
- ((len >= OUTBUFFER_CHUNK) ? len*2 : OUTBUFFER_CHUNK));
+ {
+ if (!wc->outbuffer)
+ wc->outbuffer = malloc (wc->outbuffer_size +=
+ ((len >= OUTBUFFER_CHUNK) ? len*2 : OUTBUFFER_CHUNK));
+ else
+ wc->outbuffer = realloc(wc->outbuffer, wc->outbuffer_size +=
+ ((len >= OUTBUFFER_CHUNK) ? len*2 : OUTBUFFER_CHUNK));
+ }
memcpy(wc->outbuffer + wc->outbuffer_offset, s, len);
wc->outbuffer_offset += len;
}