[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] Fixes for buglets in api_lib.c [patch]
From: |
Duncan Palmer |
Subject: |
[lwip-users] Re: [lwip] Fixes for buglets in api_lib.c [patch] |
Date: |
Thu, 09 Jan 2003 01:34:15 -0000 |
oops!
It was probably too late in the day to be sending patches ;)
On Thursday 13 June 2002 22:33, Dirk Koopman wrote:
> er...
>
> why not?
>
> Your patch seems to me to be directly equivalent; just not as terse.
>
> Remember K&R strcpy:-
>
> void strcpy(char *d, char *s)
> {
> while (*d++ = *s++)
> ;
> }
>
> Dirk
>
> On Thu, 2002-06-13 at 18:55, Duncan Palmer wrote:
> > Some of the return statements don't really return what they're intended
> > to.
> >
> > Patch attached...
> > ----
> >
> >
> > --- lwip-cvs-20020529/src/api/api_lib.c Wed May 29 15:00:16 2002
> > +++ tcpip/src/api/api_lib.c Thu Jun 13 18:51:51 2002
> > @@ -337,7 +337,8 @@
> > }
> >
> > if((msg = memp_mallocp(MEMP_API_MSG)) == NULL) {
> > - return (conn->err = ERR_MEM);
> > + conn->err = ERR_MEM;
> > + return conn->err;
> > }
> > msg->type = API_MSG_BIND;
> > msg->msg.conn = conn;
> > @@ -396,7 +397,8 @@
> > }
> >
> > if((msg = memp_mallocp(MEMP_API_MSG)) == NULL) {
> > - return (conn->err = ERR_MEM);
> > + conn->err = ERR_MEM;
> > + return conn->err;
> > }
> > msg->type = API_MSG_LISTEN;
> > msg->msg.conn = conn;
> > @@ -513,7 +515,8 @@
> > }
> >
> > if((msg = memp_mallocp(MEMP_API_MSG)) == NULL) {
> > - return (conn->err = ERR_MEM);
> > + conn->err = ERR_MEM;
> > + return conn->err;
> > }
> >
> > DEBUGF(API_LIB_DEBUG, ("netconn_send: sending %d bytes\n",
> > buf->p->tot_len)); @@ -549,7 +552,8 @@
> > }
> >
> > if((msg = memp_mallocp(MEMP_API_MSG)) == NULL) {
> > - return (conn->err = ERR_MEM);
> > + conn->err = ERR_MEM;
> > + return conn->err;
> > }
> > msg->type = API_MSG_WRITE;
> > msg->msg.conn = conn;
> > @@ -611,7 +615,8 @@
> > return ERR_VAL;
> > }
> > if((msg = memp_mallocp(MEMP_API_MSG)) == NULL) {
> > - return (conn->err = ERR_MEM);
> > + conn->err = ERR_MEM;
> > + return conn->err;
> > }
> >
> > conn->state = NETCONN_CLOSE;
>
> [This message was sent through the lwip discussion list.]
[This message was sent through the lwip discussion list.]