Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#5023 closed Patch (fixed)

Fix issues reported by code analyzer

Reported by: eyebex Owned by:
Priority: normal Component: FileZilla Server
Keywords: Cc:
Component version: Operating system type: Windows
Operating system version:

Description

Fix a few (possible) issues identified by the Visual Studio 2008 static code analyzer in the FZS Interface. Most issues are caused by uninitialized variables for certain (unlikely / presumably never to be taken) program flows, data type mismatches or hiding variables from outer scopes.

Attachments (1)

VS2008StaticCodeAnalyzer.patch (17.0 KB ) - added by eyebex 14 years ago.

Download all attachments as: .zip

Change History (5)

by eyebex, 14 years ago

comment:1 by Tim Kosse, 14 years ago

Resolution: fixed
Status: newclosed

Applied with some minor changes.

I wonder, did you actually test this? Because it failed to compile since CStdString has no GetString() method. Using cast to LPCTSTR instead.

comment:2 by eyebex, 14 years ago

That's odd, it compiles fine here. Maybe my SP1 for VS2008 makes a difference?

comment:3 by eyebex, 14 years ago

Another comment: I believe using NULL instead of 0 for pointers is better style, because it makes it easier to see that it's a pointer you're dealing with. Moreover, the next C++ standard will introduce the nullptr keyword for pointers. If NULL is used in old code, that makes migration a lot easier.

comment:4 by Tim Kosse, 14 years ago

Matter of style. I prefer 0, way faster.

Note: See TracTickets for help on using tickets.