ssh-libssh.c: fix left shift compiler warning

ssh-libssh.c:2429:21: warning: result of '1 << 31' requires 33 bits to
represent, but 'int' only has 32 bits [-Wshift-overflow=]

'len' will never be that big anyway so I converted the run-time check to
a regular assert.
This commit is contained in:
Daniel Stenberg 2018-05-03 22:16:57 +02:00
parent 7f41432c19
commit 1156fdd01d
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 1 additions and 2 deletions

View File

@ -2425,8 +2425,7 @@ static ssize_t sftp_recv(struct connectdata *conn, int sockindex,
ssize_t nread;
(void)sockindex;
if(len >= (size_t)1<<32)
len = (size_t)(1<<31)-1;
DEBUGASSERT(len < CURL_MAX_READ_SIZE);
switch(conn->proto.sshc.sftp_recv_state) {
case 0: