Fix usage of memcpy (after moving from bcopy to memcpy in an attempt to write more portable code)

This commit is contained in:
goldsimon 2010-03-31 08:07:07 +00:00
parent 8d0e721c22
commit 4c42e56c7c
2 changed files with 3 additions and 3 deletions

View File

@ -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
variable. */
/* send data from(q->payload, q->len); */
memcpy(q->payload, bufptr, q->len);
memcpy(bufptr, q->payload, 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
variable. */
/* read data into(q->payload, q->len); */
memcpy(bufptr, q->payload, q->len);
memcpy(q->payload, bufptr, q->len);
bufptr += q->len;
}
/* acknowledge that packet has been read(); */

View File

@ -223,7 +223,7 @@ unixif_input_handler(void *data)
bufptr = buf;
q = p;
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;
bufptr += q->len;
q = q->next;