From b3a5d6df0d5d115c7e4cac3c70c41a447cb6bc65 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 15 Apr 2009 14:48:56 +0000 Subject: [PATCH] bug #25763: Corrected 4 occurrences of SMEMCPY to MEMCPY; corrected indentation --- CHANGELOG | 3 +++ src/api/sockets.c | 22 +++++++++++----------- src/netif/ppp/ppp.c | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 99feaad8..99b56322 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,9 @@ HISTORY ++ New features: + 2009-04-15 Simon Goldschmidt + * sockets.c, ppp.c: bug #25763: corrected 4 occurrences of SMEMCPY to MEMCPY + 2009-04-15 Simon Goldschmidt * sockets.c: bug #26121: set_errno can be overridden diff --git a/src/api/sockets.c b/src/api/sockets.c index b7a99eed..163c71aa 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -285,17 +285,17 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen) * not be NULL if addr is valid. */ if (NULL != addr) { - LWIP_ASSERT("addr valid but addrlen NULL", addrlen != NULL); - memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof(sin); - sin.sin_family = AF_INET; - sin.sin_port = htons(port); - sin.sin_addr.s_addr = naddr.addr; + LWIP_ASSERT("addr valid but addrlen NULL", addrlen != NULL); + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + sin.sin_port = htons(port); + sin.sin_addr.s_addr = naddr.addr; - if (*addrlen > sizeof(sin)) - *addrlen = sizeof(sin); + if (*addrlen > sizeof(sin)) + *addrlen = sizeof(sin); - SMEMCPY(addr, &sin, *addrlen); + MEMCPY(addr, &sin, *addrlen); } newsock = alloc_socket(newconn); @@ -565,7 +565,7 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags, *fromlen = sizeof(sin); } - SMEMCPY(from, &sin, *fromlen); + MEMCPY(from, &sin, *fromlen); LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): addr=", s)); ip_addr_debug_print(SOCKETS_DEBUG, addr); @@ -1140,7 +1140,7 @@ lwip_getaddrname(int s, struct sockaddr *name, socklen_t *namelen, u8_t local) if (*namelen > sizeof(sin)) *namelen = sizeof(sin); - SMEMCPY(name, &sin, *namelen); + MEMCPY(name, &sin, *namelen); sock_set_errno(sock, 0); return 0; } diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index a3817dad..264b5d4b 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -1056,7 +1056,7 @@ pppWriteOverEthernet(int pd, const u_char *s, int n) pc->lastXMit = sys_jiffies(); - SMEMCPY(pb->payload, s, n); + MEMCPY(pb->payload, s, n); if(pppoe_xmit(pc->pppoe_sc, pb) != ERR_OK) { LINK_STATS_INC(link.err);