Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void qsort(
- void *base,
- size_t num, // Array size in elements.
- size_t width, // Element size in bytes.
- int (__cdecl *compare )(const void *, const void *)
- );
- char *getCommonPart(char **dictionary, int sizeDictionary)
- {
- ....
- char *currentstr = dictionary[0];
- qsort(dictionary, sizeof dictionary / sizeof dictionary[0],
- sizeof dictionary[0], cmp);
- ....
- }
- This suspicious code was found in Scilab project by PVS-Studio static code analyzer.
- Warning message is:
- V514 Dividing sizeof a pointer 'sizeof dictionary' by another value. There is a probability of logical error presence. getcommonpart.c 76
- 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