Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const char *apr_magic =
- "ACT Apricot disk image\x1a\x04";
- FLOPPY_IDENTIFY( apridisk_identify )
- {
- UINT8 header[APR_HEADER_SIZE];
- /* get header */
- floppy_image_read(floppy, &header, 0, sizeof(header));
- /* look for the magic string */
- if (memcmp(header, apr_magic, sizeof(apr_magic)) == 0)
- ...
- }
- This suspicious code was found in MAME project by PVS-Studio static code analyzer.
- Warning message is:
- V579 The memcmp function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. apridisk.c 128
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment