--- libaitio/src/sock.c 2013/08/12 23:25:35 1.1.2.3 +++ libaitio/src/sock.c 2013/08/13 00:02:59 1.1.2.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: sock.c,v 1.1.2.3 2013/08/12 23:25:35 misho Exp $ +* $Id: sock.c,v 1.1.2.4 2013/08/13 00:02:59 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -80,8 +80,10 @@ ioInitSocket(int role, int type, int proto, const char io_SetErr(elwix_GetErrno(), "%s", elwix_GetError()); e_free(s); return NULL; - } else - AIT_SET_BUFSIZ(&s->sock_buf, 0, buflen ? buflen : BUFSIZ); + } else { + buflen = buflen ? buflen : BUFSIZ; + AIT_SET_BUFSIZ(&s->sock_buf, 0, buflen); + } s->sock_fd = socket(s->sock_addr.sa.sa_family, s->sock_type, s->sock_proto); if (s->sock_fd == -1) {