Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static char* _username = "";
- static char* _password = "";
- static char* _host = "";
- static char* _hostMask = "";
- if (((_username == "") && (_password != "")) ||
- ((_username != "") && (_password == "")))
- This code is dangerous and incorrect. But sometimes it will work - when the whole code is in one module (one *.obj). The compiler will create only one empty string in memory.
- This suspicious code was found in amtsdk project by PVS-Studio static code analyzer.
- Warning message is:
- V547 Expression '_username == ""' is always false. To compare strings you should use strcmp() function. Discovery discoverysample.cpp 184
- 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