summaryrefslogtreecommitdiff
path: root/sys/ddb
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2022-08-14 14:57:39 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2022-08-14 14:57:39 +0000
commitb06b2c0f7ba92aa828a25d03769e837791ee97a1 (patch)
tree86587a71e7a48a33fd8d4d28ed19ed176555fe83 /sys/ddb
parentb4caa42c1ed201e7f8dc1afe7062a185c5230b6b (diff)
db_ctf_decompress: use size_t not off_t for length parameter
The only caller of db_ctf_decompress() passes a size_t for the length. This eliminates sign comparison warnings without using casts. OK jca@ tb@
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_ctf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/ddb/db_ctf.c b/sys/ddb/db_ctf.c
index bfb0c6d24e1..1aed046b3e4 100644
--- a/sys/ddb/db_ctf.c
+++ b/sys/ddb/db_ctf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_ctf.c,v 1.32 2022/08/11 02:56:35 tb Exp $ */
+/* $OpenBSD: db_ctf.c,v 1.33 2022/08/14 14:57:38 millert Exp $ */
/*
* Copyright (c) 2016-2017 Martin Pieuchot
@@ -53,7 +53,7 @@ struct ddb_ctf db_ctf;
static const char *db_ctf_off2name(uint32_t);
static Elf_Sym *db_ctf_idx2sym(size_t *, uint8_t);
-static char *db_ctf_decompress(const char *, size_t, off_t);
+static char *db_ctf_decompress(const char *, size_t, size_t);
const struct ctf_type *db_ctf_type_by_name(const char *, unsigned int);
const struct ctf_type *db_ctf_type_by_symbol(Elf_Sym *);
@@ -515,7 +515,7 @@ db_ctf_off2name(uint32_t offset)
}
static char *
-db_ctf_decompress(const char *buf, size_t size, off_t len)
+db_ctf_decompress(const char *buf, size_t size, size_t len)
{
z_stream stream;
char *data;
@@ -547,8 +547,8 @@ db_ctf_decompress(const char *buf, size_t size, off_t len)
goto exit;
}
- if (len < 0 || (uintmax_t)stream.total_out != (uintmax_t)len) {
- db_printf("decompression failed: %lu != %lld",
+ if (stream.total_out != len) {
+ db_printf("decompression failed: %lu != %zu",
stream.total_out, len);
goto exit;
}