mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-06-02 10:41:29 +00:00
Fix usage of memcpy (after moving from bcopy to memcpy in an attempt to write more portable code)
This commit is contained in:
parent
8d0e721c22
commit
4c42e56c7c
|
@ -143,7 +143,7 @@ low_level_output(struct tunif *tunif, struct pbuf *p)
|
||||||
time. The size of the data in each pbuf is kept in the ->len
|
time. The size of the data in each pbuf is kept in the ->len
|
||||||
variable. */
|
variable. */
|
||||||
/* send data from(q->payload, q->len); */
|
/* send data from(q->payload, q->len); */
|
||||||
memcpy(q->payload, bufptr, q->len);
|
memcpy(bufptr, q->payload, q->len);
|
||||||
bufptr += q->len;
|
bufptr += q->len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ low_level_input(struct tunif *tunif)
|
||||||
available data in the pbuf is given by the q->len
|
available data in the pbuf is given by the q->len
|
||||||
variable. */
|
variable. */
|
||||||
/* read data into(q->payload, q->len); */
|
/* read data into(q->payload, q->len); */
|
||||||
memcpy(bufptr, q->payload, q->len);
|
memcpy(q->payload, bufptr, q->len);
|
||||||
bufptr += q->len;
|
bufptr += q->len;
|
||||||
}
|
}
|
||||||
/* acknowledge that packet has been read(); */
|
/* acknowledge that packet has been read(); */
|
||||||
|
|
|
@ -223,7 +223,7 @@ unixif_input_handler(void *data)
|
||||||
bufptr = buf;
|
bufptr = buf;
|
||||||
q = p;
|
q = p;
|
||||||
while (rlen > 0) {
|
while (rlen > 0) {
|
||||||
memcpy(bufptr, q->payload, rlen > q->len? q->len: rlen);
|
memcpy(q->payload, bufptr, rlen > q->len? q->len: rlen);
|
||||||
rlen -= q->len;
|
rlen -= q->len;
|
||||||
bufptr += q->len;
|
bufptr += q->len;
|
||||||
q = q->next;
|
q = q->next;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user