(sftpfs_open_socket): fix condition of port check.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2014-04-20 18:52:04 +04:00
parent 8c040b46b8
commit c9d9a8ba93

View File

@ -77,8 +77,7 @@ sftpfs_open_socket (struct vfs_s_super *super, GError ** error)
return -1; return -1;
} }
sprintf (port, "%hu", (unsigned short) super->path_element->port); if (sprintf (port, "%hu", (unsigned short) super->path_element->port) < 0)
if (port == NULL)
{ {
g_set_error (error, MC_ERROR, -1, _("sftp: Invalid port value.")); g_set_error (error, MC_ERROR, -1, _("sftp: Invalid port value."));
return -1; return -1;