1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-07-28 01:41:49 +03:00

tidy-up: formatting nits

Whitespace and redundant parenthesis in `return`s.

Closes #1029
This commit is contained in:
Viktor Szakats
2023-05-04 11:31:40 +00:00
parent 272a17ce26
commit fc003d4dc3
8 changed files with 22 additions and 23 deletions

View File

@ -2314,7 +2314,7 @@ _libssh2_channel_packet_data_len(LIBSSH2_CHANNEL * channel, int stream_id)
&& (channel->local.id == read_local_id) && (channel->local.id == read_local_id)
&& (channel->remote.extended_data_ignore_mode && (channel->remote.extended_data_ignore_mode
== LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE))) { == LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE))) {
return (read_packet->data_len - read_packet->data_head); return read_packet->data_len - read_packet->data_head;
} }
read_packet = next_packet; read_packet = next_packet;

View File

@ -1,5 +1,4 @@
#define LIBSSH2_CRYPTO_C #define LIBSSH2_CRYPTO_C
#include "libssh2_priv.h" #include "libssh2_priv.h"
#if defined(LIBSSH2_OPENSSL) || defined(LIBSSH2_WOLFSSL) #if defined(LIBSSH2_OPENSSL) || defined(LIBSSH2_WOLFSSL)

View File

@ -935,7 +935,7 @@ int _libssh2_check_length(struct string_buf *buf, size_t len)
{ {
unsigned char *endp = &buf->data[buf->len]; unsigned char *endp = &buf->data[buf->len];
size_t left = endp - buf->dataptr; size_t left = endp - buf->dataptr;
return ((len <= left) && (left <= buf->len)); return (len <= left) && (left <= buf->len);
} }
int _libssh2_eob(struct string_buf *buf) int _libssh2_eob(struct string_buf *buf)

View File

@ -3280,7 +3280,7 @@ clean_exit:
if(md_ctx) if(md_ctx)
EVP_MD_CTX_free(md_ctx); EVP_MD_CTX_free(md_ctx);
return (rc == 1 ? 0 : -1); return (rc == 1) ? 0 : -1;
} }
int int

View File

@ -632,11 +632,11 @@ sftp_packet_requirev(LIBSSH2_SFTP *sftp, int num_valid_responses,
*/ */
static int sftp_attrsize(unsigned long flags) static int sftp_attrsize(unsigned long flags)
{ {
return (4 + /* flags(4) */ return 4 + /* flags(4) */
((flags & LIBSSH2_SFTP_ATTR_SIZE) ? 8 : 0) + ((flags & LIBSSH2_SFTP_ATTR_SIZE) ? 8 : 0) +
((flags & LIBSSH2_SFTP_ATTR_UIDGID) ? 8 : 0) + ((flags & LIBSSH2_SFTP_ATTR_UIDGID) ? 8 : 0) +
((flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) ? 4 : 0) + ((flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) ? 4 : 0) +
((flags & LIBSSH2_SFTP_ATTR_ACMODTIME) ? 8 : 0)); ((flags & LIBSSH2_SFTP_ATTR_ACMODTIME) ? 8 : 0);
/* atime + mtime as u32 */ /* atime + mtime as u32 */
} }
@ -681,7 +681,7 @@ sftp_attr2bin(unsigned char *p, const LIBSSH2_SFTP_ATTRIBUTES * attrs)
_libssh2_store_u32(&s, (uint32_t)attrs->mtime); _libssh2_store_u32(&s, (uint32_t)attrs->mtime);
} }
return (s - p); return s - p;
} }
/* sftp_bin2attr /* sftp_bin2attr
@ -758,7 +758,7 @@ sftp_bin2attr(LIBSSH2_SFTP_ATTRIBUTES *attrs, const unsigned char *p,
} }
} }
return (buf.dataptr - buf.data); return buf.dataptr - buf.data;
} }
/* ************ /* ************