diff --git a/appl/telnet/telnet/network.c b/appl/telnet/telnet/network.c index f1d76f2c0..6c1ed53a3 100644 --- a/appl/telnet/telnet/network.c +++ b/appl/telnet/telnet/network.c @@ -36,7 +36,8 @@ RCSID("$Id$"); Ring netoring, netiring; -unsigned char netobuf[2*BUFSIZ], netibuf[BUFSIZ]; +size_t netobufsize = 64*1024; +size_t netibufsize = 64*1024; /* * Initialize internal network data structures. @@ -45,10 +46,17 @@ unsigned char netobuf[2*BUFSIZ], netibuf[BUFSIZ]; void init_network(void) { - if (ring_init(&netoring, netobuf, sizeof netobuf) != 1) { + void *obuf, *ibuf; + + if ((obuf = malloc(netobufsize)) == NULL) + exit(1); + if ((ibuf = malloc(netibufsize)) == NULL) + exit(1); + + if (ring_init(&netoring, obuf, netobufsize) != 1) { exit(1); } - if (ring_init(&netiring, netibuf, sizeof netibuf) != 1) { + if (ring_init(&netiring, ibuf, netibufsize) != 1) { exit(1); } NetTrace = stdout;