Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static VOID
- AddScreenSavers(HWND hwndDlg, PDATA pData)
- {
- ...
- LPTSTR lpBackSlash;
- lpBackSlash = _tcsrchr(szSearchPath, _T('\\'));
- if (lpBackSlash != NULL)
- {
- lpBackSlash = '\0';
- SearchScreenSavers(hwndScreenSavers, szSearchPath, pData);
- }
- }
- The programmer simply zeroed the IpBackSlash pointer instead of throwing off everything after the last \ character.
- This is what should have been written here: *lpBackSlash = '\0';
- This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
- Warning message is:
- V527 It is odd that the L'\0' value is assigned to 'wchar_t' type pointer. Probably meant: *lpBackSlash = L'\0'. desk screensaver.c 453
- 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