Opened 10 years ago

Closed 10 years ago

Last modified 10 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 10 years ago.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by eyebex

comment:1 Changed 10 years ago by Tim Kosse

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 Changed 10 years ago by eyebex

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

comment:3 Changed 10 years ago by eyebex

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 Changed 10 years ago by Tim Kosse

Matter of style. I prefer 0, way faster.

Note: See TracTickets for help on using tickets.