Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int rr_cmp(uchar *a,uchar *b)
- {
- if (a[0] != b[0])
- return (int) a[0] - (int) b[0];
- if (a[1] != b[1])
- return (int) a[1] - (int) b[1];
- if (a[2] != b[2])
- return (int) a[2] - (int) b[2];
- if (a[3] != b[3])
- return (int) a[3] - (int) b[3];
- if (a[4] != b[4])
- return (int) a[4] - (int) b[4];
- if (a[5] != b[5])
- return (int) a[1] - (int) b[5]; <<<---
- if (a[6] != b[6])
- return (int) a[6] - (int) b[6];
- return (int) a[7] - (int) b[7];
- }
- This is what should have been written here: return (int) a[5] - (int) b[5];
- This suspicious code was found in MySQL project by PVS-Studio static code analyzer.
- Warning message is:
- V525 The code containing the collection of similar blocks. Check items '0', '1', '2', '3', '4', '1', '6' in lines 680, 682, 684, 689, 691, 693, 695. sql records.cc 680
- 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