aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-21 11:15:40 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-23 09:18:26 +0000
commitc70694bd8f40a6e0aee38b9d0be821ab18f4db33 (patch)
treee3f3d26e76bfd599e75eaedaa624df759a9748f8
parentcompletions/zsh: unbreak with BSD find(1) (diff)
client: explicitly use a 64-bit type for ‘total_len’
This fixes an out-of-range comparison in 32-bit builds: client.c:289:19: error: result of comparison of constant 4294967296 with expression of type 'size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (total_len >= 1llu << (8 * sizeof(uint32_t)) || ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r--client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/client.c b/client.c
index cb24ab12..c4a36f74 100644
--- a/client.c
+++ b/client.c
@@ -263,7 +263,7 @@ main(int argc, char *const *argv)
};
/* Total packet length, not (yet) including argv[] */
- size_t total_len = (
+ uint64_t total_len = (
sizeof(data) +
cwd_len +
term_len +