1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-03 22:13:11 +03:00

publickey_init: errors are negative, fix check

Detected by clang-analyzer.
This commit is contained in:
Daniel Stenberg
2012-08-08 15:15:30 +02:00
parent 6c27922ac1
commit 1abf2057de

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org> /* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
* Copyright (c) 2010 by Daniel Stenberg * Copyright (c) 2010-2012 by Daniel Stenberg
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, * Redistribution and use in source and binary forms,
@@ -384,7 +384,7 @@ static LIBSSH2_PUBLICKEY *publickey_init(LIBSSH2_SESSION *session)
_libssh2_error(session, LIBSSH2_ERROR_EAGAIN, _libssh2_error(session, LIBSSH2_ERROR_EAGAIN,
"Would block sending publickey version packet"); "Would block sending publickey version packet");
return NULL; return NULL;
} else if (rc) { } else if (rc < 0) {
_libssh2_error(session, rc, _libssh2_error(session, rc,
"Unable to send publickey version packet"); "Unable to send publickey version packet");
goto err_exit; goto err_exit;