Correct calculating of offsets when memcpy returned data.

This commit is contained in:
jmc 2002-12-01 12:05:11 +00:00
parent 5c184fab23
commit 3b7f83f77f
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fwohci.c,v 1.60 2002/11/30 06:09:42 jmc Exp $ */ /* $NetBSD: fwohci.c,v 1.61 2002/12/01 12:05:11 jmc Exp $ */
/*- /*-
* Copyright (c) 2000 The NetBSD Foundation, Inc. * Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -49,7 +49,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.60 2002/11/30 06:09:42 jmc Exp $"); __KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.61 2002/12/01 12:05:11 jmc Exp $");
#define DOUBLEBUF 1 #define DOUBLEBUF 1
#define NO_THREAD 1 #define NO_THREAD 1
@ -3639,7 +3639,7 @@ fwohci_parse_input(struct fwohci_softc *sc, void *arg, struct fwohci_pkt *pkt)
{ {
struct ieee1394_abuf *ab = (struct ieee1394_abuf *)arg; struct ieee1394_abuf *ab = (struct ieee1394_abuf *)arg;
u_int64_t addr; u_int64_t addr;
u_int32_t *cur; u_int8_t *cur;
int i, count, ret; int i, count, ret;
ab->ab_tcode = (pkt->fp_hdr[0] >> 4) & 0xf; ab->ab_tcode = (pkt->fp_hdr[0] >> 4) & 0xf;
@ -3687,7 +3687,7 @@ fwohci_parse_input(struct fwohci_softc *sc, void *arg, struct fwohci_pkt *pkt)
ab->ab_data[0] = pkt->fp_hdr[3]; ab->ab_data[0] = pkt->fp_hdr[3];
else { else {
count = 0; count = 0;
cur = ab->ab_data; cur = (u_int8_t *)ab->ab_data;
for (i = 0; i < pkt->fp_uio.uio_iovcnt; i++) { for (i = 0; i < pkt->fp_uio.uio_iovcnt; i++) {
memcpy(cur, pkt->fp_iov[i].iov_base, memcpy(cur, pkt->fp_iov[i].iov_base,
pkt->fp_iov[i].iov_len); pkt->fp_iov[i].iov_len);