summaryrefslogtreecommitdiffstats
path: root/usr.bin/ctfdump
diff options
context:
space:
mode:
authoruwe <uwe@openbsd.org>2017-09-23 12:25:39 +0000
committeruwe <uwe@openbsd.org>2017-09-23 12:25:39 +0000
commit60eaf76f7061304bdbd15bbf74a75d58f353983d (patch)
treee351c3fd7ac2f25bc804d0f50f8a9663dfa1bbd8 /usr.bin/ctfdump
parentShow floating-point encoding by name in ctfdump(1) (diff)
downloadwireguard-openbsd-60eaf76f7061304bdbd15bbf74a75d58f353983d.tar.xz
wireguard-openbsd-60eaf76f7061304bdbd15bbf74a75d58f353983d.zip
Fix off by one in ctf_enc2name (who uses SIGNED BOOL anyway?)
ok mpi
Diffstat (limited to 'usr.bin/ctfdump')
-rw-r--r--usr.bin/ctfdump/ctfdump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ctfdump/ctfdump.c b/usr.bin/ctfdump/ctfdump.c
index f30e608e7be..6b3e035314b 100644
--- a/usr.bin/ctfdump/ctfdump.c
+++ b/usr.bin/ctfdump/ctfdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctfdump.c,v 1.7 2017/09/23 12:24:31 uwe Exp $ */
+/* $OpenBSD: ctfdump.c,v 1.8 2017/09/23 12:25:39 uwe Exp $ */
/*
* Copyright (c) 2016 Martin Pieuchot <mpi@openbsd.org>
@@ -551,7 +551,7 @@ ctf_enc2name(uint16_t enc)
if (enc == CTF_INT_VARARGS)
return "VARARGS";
- if (enc > 0 && enc < nitems(enc_name))
+ if (enc > 0 && enc <= nitems(enc_name))
return enc_name[enc - 1];
snprintf(invalid, sizeof(invalid), "0x%x", enc);