cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: Bug in ssh.c?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 2 Sep 2009 23:06:01 +0200 (CEST)

On Wed, 2 Sep 2009, Daniel Johnson wrote:

> ../../curl/lib/ssh.c:239:10: warning: overflow converting case value to
> switch condition type (-6 to 4294967290)
> case LIBSSH2_ERROR_ALLOC:
> ^
> /Volumes/MacintoshHD/deps/include/libssh2.h:326:49: note: instantiated from:
> #define LIBSSH2_ERROR_ALLOC -6
> ^
> 1 diagnostic generated.
>
> Sure enough, err is declared to be unsigned long. Perhaps
> sftp_libssh2_error_to_CURLE should take a signed long instead?

Whoa, nice catch. Since the 'err' passed in is a plain 'int' in every place I
think the function should accept that.

But as a secondary error: LIBSSH2_ERROR_ALLOC is not a legitimate sftp error
so it shouldn't be in that switch() statement in the first place!

Fix committed, thanks!

-- 
  / daniel.haxx.se
Received on 2009-09-02

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET