fix ptr/address of ptr confusion?
This commit is contained in:
parent
f2cb861ec7
commit
0bbc63aaf5
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
|
|||
msg.flags = read_write;
|
||||
msg.len = *size;
|
||||
msg.buf = (u8*)malloc(*size);
|
||||
memcpy(&msg.buf, &data, *size);
|
||||
memcpy(msg.buf, data, *size);
|
||||
|
||||
rdwr.msgs = &msg;
|
||||
rdwr.nmsgs = 1;
|
||||
|
|
@ -53,7 +53,7 @@ s32 i2c_smbus_linux::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
|
|||
if(read_write == I2C_SMBUS_READ)
|
||||
{
|
||||
*size = msg.len;
|
||||
memcpy(data, &msg.buf, *size);
|
||||
memcpy(data, msg.buf, *size);
|
||||
}
|
||||
|
||||
free(msg.buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue