[WHOAMI]
authorDmitry Chapyshev <dmitry@reactos.org>
Sat, 30 Jul 2016 16:00:10 +0000 (16:00 +0000)
committerDmitry Chapyshev <dmitry@reactos.org>
Sat, 30 Jul 2016 16:00:10 +0000 (16:00 +0000)
commit01bab59e216b2c8d364ec713f4d93c75ec5243ff
tree03c9731777dd8adaf1c2c01a9dc6317cb75223d3
parent19832336a1232cb9b2650d3ebbdde210ad853ad7
[WHOAMI]
[ARP]
[TRACERT]
- Incorrect to compare the variable of BOOL type with TRUE. Any non-zero value is considered to be "true".

[FREELDR]
- Variable is assigned values twice
- The 'strlen' function was called multiple times inside the body of a loop
- It is inefficient to identify an empty string by using 'strlen(str) > 0' construct. A more efficient way is to check: str[0] != 0

[NTOBJSHEX]
[SLAYER]
[CMICONTROL]
- It is inefficient to identify an empty string by using 'strlen(str) > 0' construct. A more efficient way is to check: str[0] != 0

[SHELL32]
- There is no sense in testing the pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error
- Verifying that a pointer value is not NULL is not required. The 'if (ptr != NULL)' check can be removed
- Fix copy-paste error in CMenuFocusManager::PlaceHooks()

[SRCLIENT]
- Remove unneeded check. A part of conditional expression is always false.

[DISK]
[ATAPI]
- Variable is assigned values twice

* All bugs found by PVS-Studio

svn path=/trunk/; revision=72059
16 files changed:
reactos/base/applications/cmdutils/whoami/whoami.c
reactos/base/applications/network/arp/arp.c
reactos/base/applications/network/tracert/tracert.c
reactos/boot/freeldr/freeldr/disk/scsiport.c
reactos/boot/freeldr/freeldr/lib/fs/fs.c
reactos/boot/freeldr/freeldr/ntldr/winldr.c
reactos/boot/freeldr/freeldr/ntldr/wlregistry.c
reactos/dll/shellext/ntobjshex/regfolder.cpp
reactos/dll/shellext/slayer/slayer.c
reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
reactos/dll/win32/shell32/shellmenu/CMenuBand.cpp
reactos/dll/win32/shell32/shellmenu/CMenuFocusManager.cpp
reactos/dll/win32/srclient/srclient_main.c
reactos/drivers/storage/class/disk/disk.c
reactos/drivers/storage/ide/atapi/atapi.c
reactos/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp