Skip to content

Commit

Permalink
Do not use sizeof() on a pointer
Browse files Browse the repository at this point in the history
The problem was spotted by cppcheck:
Using 'sizeof' on array given as function argument returns size of a
pointer.
  • Loading branch information
Ludovic Rousseau authored and neomilium committed Apr 4, 2013
1 parent 4254941 commit 74efe0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nfcforum_type4_tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ nfcforum_type4_ndef_tag_application_select(nfc_device_t* pnd)
}

bool
nfcforum_type4_select(nfc_device_t* pnd, const byte_t fileID[2])
nfcforum_type4_select(nfc_device_t* pnd, const byte_t *fileID)
{
byte_t select_cmd[] = { CLEAR_TEXT, SELECT, 0x00, 0x00, 0x02, 0x00, 0x00 };
memcpy(select_cmd + 5, fileID, sizeof(fileID));
memcpy(select_cmd + 5, fileID, 2);
return nfcforum_type4_transceive(pnd, select_cmd,sizeof(select_cmd), NULL, NULL);
}

0 comments on commit 74efe0b

Please sign in to comment.