Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BOOL TortoiseBlame::OpenFile(const TCHAR *fileName)
- {
- ...
- // check each line for illegal utf8 sequences.
- // If one is found, we treat
- // the file as ASCII, otherwise we assume
- // an UTF8 file.
- char * utf8CheckBuf = lineptr;
- while ((bUTF8)&&(*utf8CheckBuf))
- {
- if ((*utf8CheckBuf == 0xC0)||
- (*utf8CheckBuf == 0xC1)||
- (*utf8CheckBuf >= 0xF5))
- {
- bUTF8 = false;
- break;
- }
- ...
- }
- ...
- }
- This suspicious code was found in TortoiseSVN project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression '* utf8CheckBuf == 0xC0' is always false. The value range of signed char type: [-128, 127]. tortoiseblame.cpp 310
- 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
Advertisement